Example #1
0
 @Test
 public void shouldReturnSecondPage1() {
   List<String> list = Arrays.asList("a", "b", "c", "d", "e", "f");
   List<String> page = Paging.asPage(list, 1, 2).getPage();
   assertEquals(Arrays.asList("b"), page);
 }
Example #2
0
 @Test
 public void shouldReturnLastPage2() {
   List<String> list = Arrays.asList("a", "b", "c", "d", "e", "f");
   List<String> page = Paging.asPage(list, 2, 3).getPage();
   assertEquals(Arrays.asList("e", "f"), page);
 }
Example #3
0
 @Test
 public void shouldReturnAll() {
   List<String> list = Arrays.asList("a", "b", "c", "d", "e", "f");
   List<String> page = Paging.asPage(list, -1, -1).getPage();
   assertEquals(list, page);
 }