@Test public void testForEach() { IntList list = new IntList(); IntList other = new IntList(); list.forEach(other::add); assertThat(other.toArray()).isEmpty(); list.add(10); list.add(5); list.forEach(other::add); assertThat(list.toArray()).containsExactly(10, 5); }
public void forEach(IntConsumer action) { java.util.Objects.requireNonNull(action); for (int i = 0; i < _limit; i++) { action.accept(_array[i]); } }
IntList { public void forEach(IntConsumer action) { java.util.Objects.requireNonNull(action); for (int i = 0; i < _limit; i++) { action.accept(_array[i]); } } }
IntList { public void forEach(IntConsumer action) { java.util.Objects.requireNonNull(action); for (int i = 0; i < _limit; i++) { action.accept(_array[i]); } } IntList();  IntList(final int initialCapacity);  IntList(final IntList list);  IntList(final int initialCapacity, int fillvalue); }
IntList { public void forEach(IntConsumer action) { java.util.Objects.requireNonNull(action); for (int i = 0; i < _limit; i++) { action.accept(_array[i]); } } IntList();  IntList(final int initialCapacity);  IntList(final IntList list);  IntList(final int initialCapacity, int fillvalue); void add(final int index, final int value); boolean add(final int value); boolean addAll(final IntList c); boolean addAll(final int index, final IntList c); void clear(); boolean contains(final int o); boolean containsAll(final IntList c); @Override boolean equals(final Object o); int get(final int index); @Override int hashCode(); int indexOf(final int o); boolean isEmpty(); int lastIndexOf(final int o); int remove(final int index); boolean removeValue(final int value); boolean removeAll(final IntList c); boolean retainAll(final IntList c); int set(final int index, final int element); int size(); int[] toArray(); int[] toArray(final int[] a); IntStream stream(); void replaceAll(IntUnaryOperator operator); void sort(); Spliterator.OfInt spliterator(); boolean removeIf(IntPredicate filter); void forEach(IntConsumer action); }
IntList { public void forEach(IntConsumer action) { java.util.Objects.requireNonNull(action); for (int i = 0; i < _limit; i++) { action.accept(_array[i]); } } IntList();  IntList(final int initialCapacity);  IntList(final IntList list);  IntList(final int initialCapacity, int fillvalue); void add(final int index, final int value); boolean add(final int value); boolean addAll(final IntList c); boolean addAll(final int index, final IntList c); void clear(); boolean contains(final int o); boolean containsAll(final IntList c); @Override boolean equals(final Object o); int get(final int index); @Override int hashCode(); int indexOf(final int o); boolean isEmpty(); int lastIndexOf(final int o); int remove(final int index); boolean removeValue(final int value); boolean removeAll(final IntList c); boolean retainAll(final IntList c); int set(final int index, final int element); int size(); int[] toArray(); int[] toArray(final int[] a); IntStream stream(); void replaceAll(IntUnaryOperator operator); void sort(); Spliterator.OfInt spliterator(); boolean removeIf(IntPredicate filter); void forEach(IntConsumer action);  }