DoubleList { public void replaceAll(DoubleUnaryOperator operator) { java.util.Objects.requireNonNull(operator); for (int i = 0; i < _limit; i++) { _array[i] = operator.applyAsDouble(_array[i]); } } DoubleList();  DoubleList(final int initialCapacity);  DoubleList(final DoubleList list);  DoubleList(final int initialCapacity, double fillvalue); void add(final int index, final double value); boolean add(final double value); boolean addAll(final DoubleList c); boolean addAll(final int index, final DoubleList c); void clear(); boolean contains(final double o); boolean containsAll(final DoubleList c); @Override boolean equals(final Object o); double get(final int index); @Override int hashCode(); int indexOf(final double o); boolean isEmpty(); int lastIndexOf(final double o); double remove(final int index); boolean removeValue(final double o); boolean removeAll(final DoubleList c); boolean retainAll(final DoubleList c); double set(final int index, final double element); int size(); double[] toArray(); double[] toArray(final double[] a); DoubleStream stream(); void replaceAll(DoubleUnaryOperator operator); void sort(); Spliterator.OfDouble spliterator(); boolean removeIf(DoublePredicate filter); void forEach(DoubleConsumer action);  }
@Test public void testReplaceAll() { DoubleList list = new DoubleList(); list.replaceAll(o -> o + 1); assertThat(list.toArray()).isEmpty(); list.add(1d); list.add(2d); list.replaceAll(o -> o + 1); assertThat(list.toArray()).containsExactly(2d, 3d); }