IntList { public boolean removeIf(IntPredicate filter) { java.util.Objects.requireNonNull(filter); boolean removed = false; int i = 0; while (i < _limit) { if (filter.test(_array[i])) { remove(i); removed = true; } else { i++; } } return removed; } 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);  }
@Test public void testRemoveIf() { IntList list = new IntList(); list.removeIf(o -> o < 7); assertThat(list.toArray()).isEmpty(); list.add(10); list.add(5); list.removeIf(o -> o < 7); assertThat(list.toArray()).containsExactly(10); }