code: private final void applyPagination(final Query query,
              final PaginationData pagination) {
          query.setFirstResult(
                  (pagination.getPageNumber() - 1) * pagination.getPageSize());
          query.setMaxResults(pagination.getPageSize());
      }
docs: Applies pagination to the query.
  
  @param query
  query to apply the pagination to
  @param pagination
  pagination to apply