### Question:
Paging { public int getTotalPages() { return totalPages; } Paging(List<T> items, int itemsPerPage);  Paging(T[] items, int itemsPerPage); int getCurrentPage(); int getTotalPages(); int getTotalItems(); Object getItem(int index); void nextPage(); void previousPage(); boolean isFirstPage(); boolean isLastPage(); boolean onPageHasItem(int index); int getItemsCountOnCurrentPage();  }### Answer:
@Test public void shouldHaveTotalPages() { Paging paging = new Paging(new Object[] {}, 2); assertEquals(0, paging.getTotalPages()); paging = new Paging(new Object[] { 0, 1 }, 2); assertEquals(1, paging.getTotalPages()); paging = new Paging(new Object[] { 0, 1, 2 }, 2); assertEquals(2, paging.getTotalPages()); paging = new Paging(new Object[] { 0, 1, 2, 3 }, 2); assertEquals(2, paging.getTotalPages()); paging = new Paging(new Object[] { 0, 1, 2, 3, 4 }, 2); assertEquals(3, paging.getTotalPages()); }