@Test public void testBatchList() throws Exception { List<String> list = Arrays.asList("1", "2", "3", "4", "5", "6"); BatchedList<String> l; l = getBatchedList(list, null, null, 10); assertEquals(Arrays.asList("1", "2", "3", "4", "5", "6"), l.getList()); assertEquals(6, l.numItems); assertFalse(l.hasMoreItems); l = getBatchedList(list, BigInteger.valueOf(4), null, 10); assertEquals(Arrays.asList("1", "2", "3", "4"), l.getList()); assertEquals(6, l.numItems); assertTrue(l.hasMoreItems); l = getBatchedList(list, null, null, 4); assertEquals(Arrays.asList("1", "2", "3", "4"), l.getList()); assertEquals(6, l.numItems); assertTrue(l.hasMoreItems); l = getBatchedList(list, BigInteger.valueOf(6), null, 10); assertEquals(Arrays.asList("1", "2", "3", "4", "5", "6"), l.getList()); assertEquals(6, l.numItems); assertFalse(l.hasMoreItems); l = getBatchedList(list, BigInteger.valueOf(42), null, 10); assertEquals(Arrays.asList("1", "2", "3", "4", "5", "6"), l.getList()); assertEquals(6, l.numItems); assertFalse(l.hasMoreItems); l = getBatchedList(list, BigInteger.valueOf(4), BigInteger.valueOf(1), 10); assertEquals(Arrays.asList("2", "3", "4", "5"), l.getList()); assertEquals(6, l.numItems); assertTrue(l.hasMoreItems); l = getBatchedList(list, BigInteger.valueOf(4), BigInteger.valueOf(2), 10); assertEquals(Arrays.asList("3", "4", "5", "6"), l.getList()); assertEquals(6, l.numItems); assertFalse(l.hasMoreItems); l = getBatchedList(list, BigInteger.valueOf(4), BigInteger.valueOf(3), 10); assertEquals(Arrays.asList("4", "5", "6"), l.getList()); assertEquals(6, l.numItems); assertFalse(l.hasMoreItems); l = getBatchedList(list, BigInteger.valueOf(4), BigInteger.valueOf(5), 10); assertEquals(Arrays.asList("6"), l.getList()); assertEquals(6, l.numItems); assertFalse(l.hasMoreItems); l = getBatchedList(list, BigInteger.valueOf(4), BigInteger.valueOf(6), 10); assertEquals(Arrays.asList(), l.getList()); assertEquals(6, l.numItems); assertFalse(l.hasMoreItems); l = getBatchedList(list, BigInteger.valueOf(1), BigInteger.valueOf(42), 10); assertEquals(Arrays.asList(), l.getList()); assertEquals(6, l.numItems); assertFalse(l.hasMoreItems); }
public static <T> List<T> batchList(List<T> list, BigInteger maxItems, BigInteger skipCount, int defaultMax) { return getBatchedList(list, maxItems, skipCount, defaultMax).getList(); }
ListUtils { public static <T> List<T> batchList(List<T> list, BigInteger maxItems, BigInteger skipCount, int defaultMax) { return getBatchedList(list, maxItems, skipCount, defaultMax).getList(); } }
ListUtils { public static <T> List<T> batchList(List<T> list, BigInteger maxItems, BigInteger skipCount, int defaultMax) { return getBatchedList(list, maxItems, skipCount, defaultMax).getList(); } private  ListUtils(); }
ListUtils { public static <T> List<T> batchList(List<T> list, BigInteger maxItems, BigInteger skipCount, int defaultMax) { return getBatchedList(list, maxItems, skipCount, defaultMax).getList(); } private  ListUtils(); static List<T> batchList(List<T> list, BigInteger maxItems, BigInteger skipCount, int defaultMax); static BatchedList<T> getBatchedList(List<T> list, BigInteger maxItems, BigInteger skipCount,
            int defaultMax); }
ListUtils { public static <T> List<T> batchList(List<T> list, BigInteger maxItems, BigInteger skipCount, int defaultMax) { return getBatchedList(list, maxItems, skipCount, defaultMax).getList(); } private  ListUtils(); static List<T> batchList(List<T> list, BigInteger maxItems, BigInteger skipCount, int defaultMax); static BatchedList<T> getBatchedList(List<T> list, BigInteger maxItems, BigInteger skipCount,
            int defaultMax);  }