This commit is contained in:
Looly
2021-08-17 21:57:41 +08:00
parent c6291993f9
commit 2b04713104
3 changed files with 15 additions and 17 deletions

View File

@@ -101,7 +101,7 @@ public class ListUtilTest {
int[] d1 = ListUtil.page(0,8,a).stream().mapToInt(Integer::valueOf).toArray();
Assert.assertArrayEquals(new int[]{1,2,3,4,5},d1);
// page with consumer
List<List<Integer>> pageListData = new ArrayList<>();
ListUtil.page(a, 2, pageListData::add);
Assert.assertArrayEquals(new int[]{1, 2}, pageListData.get(0).stream().mapToInt(Integer::valueOf).toArray());