ListUtil { public static <T> void forEach(int startIndex, int spanNum, Iterable<? extends T> elements, BiConsumer<Integer, ? super T> action) { if (ObjectUtil.orIsNull(elements, action)) throw new IllegalArgumentException("Incorrect parameters !"); int index = 1; for (T element : elements) { if (index <= NumberUtil.limitInt(startIndex, 0, Integer.MAX_VALUE)) { index++; continue; } action.accept(index - 1, element); index = index + NumberUtil.limitInt(spanNum, 1, Integer.MAX_VALUE); } }  static List<E> newArrayList(); static List<E> newArrayList(int initialCapacity); static List<E> newArrayList(Collection<? extends E> c); @SafeVarargs static List<E> buildArrayList(E... values); @SuppressWarnings("rawtypes") static Class<? extends List> getArrayListClass(); static List<E> newLinkedList(); static List<E> newLinkedList(Collection<? extends E> c); @SafeVarargs static List<E> buildLinkedList(E... values); @SuppressWarnings("rawtypes") static Class<? extends List> getLinkedListClass(); static boolean isEmpty(List<?> list); static void forEach(int startIndex, int spanNum, Iterable<? extends T> elements,
			BiConsumer<Integer, ? super T> action);  }
@Test public void testForEach() { ListUtil.forEach(0, 2, ListUtil.buildArrayList("0", "2", "4"), (index, item) -> { assertTrue(index == StringUtil.toInt(item)); }); ListUtil.forEach(2, 1, ListUtil.buildArrayList("a", "b", "c"), (index, item) -> { assertTrue(index == 2); assertEquals(item, "c"); }); }