ValueListHandler { public List<T> nextPage() { if (currentPage < (list.size() / pageSize)) { ++currentPage; } return subList(); } ValueListHandler();  ValueListHandler(List<T> oldList); List<T> nextPage(); List<T> prevPage(); int getPageSize(); void setPageSize(int pageSize); int getListSize();  }
@Test public final void testNextPage() { List<Integer> page = target.nextPage(); assertEquals(10, page.size()); assertEquals(Integer.valueOf(3), page.get(3 - 1)); }
@Test public final void testOverflow() { target.nextPage(); target.nextPage(); target.nextPage(); target.nextPage(); target.nextPage(); target.nextPage(); target.nextPage(); target.nextPage(); }