### Question:
ResultsPage { public int getNextPage() { return (results.size() == pageSize && page != -1) ? page + 1 : -1; } ResultsPage(List<Object> results, int pageSize, int page); List<Object> getResults(); int getResultsStart(); int getResultsEnd(); int getNextPage(); int getPreviousPage(); @Override boolean equals(final Object o); @Override int hashCode();  }### Answer:
@Test public void testGetNextPage() { log.info("testGetNextPage"); ResultsPage hasMore = new ResultsPage(RESULTS, 4, 1); assertEquals(2, hasMore.getNextPage()); ResultsPage noMore = new ResultsPage(RESULTS, 5, 1); assertEquals(-1, noMore.getNextPage()); ResultsPage all = new ResultsPage(RESULTS, 4, -1); assertEquals(-1, all.getNextPage()); log.info("Test successful!"); }