if (actualCount >= limit) {
// next link
// The uri might have other query/matrix parameters, just replace the limit and offset
// for next and prev links and leave the rest untouched
uriBuilder = UriBuilder.fromUri(uriInfo.getRequestUri());
uriBuilder.replaceQueryParam(QueryParameters.JPARS_PAGING_OFFSET, nextOffset);
links.add(new LinkV2(ReservedWords.JPARS_REL_NEXT, uriBuilder.build().toString()));
resultCollection.setHasMore(true);
} else {
resultCollection.setHasMore(false);
}