SearchResultImpl implements SearchResult { public long getPage() { if (offset == 0 || limit == 0) return 1; return (long) Math.floor(offset / limit) + 1; } SearchResultImpl(SearchQuery query, long hitCount, long documentCount); void addResultItem(SearchResultItem item); SearchResultItem[] getItems(); long getLimit(); long getOffset(); long getPage(); long getPageSize(); SearchQuery getQuery(); void setSearchTime(long time); long getSearchTime(); long getHitCount(); long getDocumentCount(); void setDocumentCount(long count); String toXml();  }
@Test public void testGetPage() { long page = (long) Math.floor(offset / limit) + 1; assertEquals(page, result.getPage()); }