### Question:
Pageable { public Pageable(int pageSize, List<T> list) { this.pageSize = pageSize; this.list = list; this.currentPage = 1; if (pageSize > 0) { if (list.size() % pageSize == 0) { totalPages = list.size() / pageSize; } else { totalPages = (list.size() / pageSize) + 1; } } else { totalPages = 1; } setCurrentPage(1); } Pageable(int pageSize, List<T> list); int getPageSize(); List<T> getList(); List<T> getPaginatedList(); int getCurrentPage(); int getTotalPages(); boolean hasMorePages(); boolean isPaginationComplete(); void nextPage();  }### Answer:
@Test public void pageableTest() { List list = new ArrayList<>(); for (int i=1; i<=1240; i++) { list.add(String.valueOf(i)); } Pageable pageable = new Pageable(100, list); Assert.assertEquals(1, pageable.getCurrentPage()); Assert.assertEquals(13, pageable.getTotalPages()); Assert.assertEquals(100, pageable.getPageSize()); Assert.assertTrue(pageable.hasMorePages()); Assert.assertFalse(pageable.isPaginationComplete()); for (int i=1; i<=13; i++) { if (i <= 12) { Assert.assertEquals(100, pageable.getPaginatedList().size()); Assert.assertTrue(pageable.hasMorePages()); } else if (i == 13) { Assert.assertEquals(40, pageable.getPaginatedList().size()); Assert.assertFalse(pageable.hasMorePages()); } Assert.assertEquals(i, pageable.getCurrentPage()); pageable.nextPage(); if (i <= 12) { Assert.assertFalse(pageable.isPaginationComplete()); } else if (i == 13) { Assert.assertTrue(pageable.isPaginationComplete()); } } }