### Question:
OptionalDouble { public void ifPresent(DoubleConsumer consumer) { optional.ifPresent(consumer); } private  OptionalDouble(); private  OptionalDouble(double value); static OptionalDouble empty(); static OptionalDouble of(double value); static OptionalDouble ofNullable(Double value); Optional<Double> boxed(); OptionalDouble filter(@NonNull DoublePredicate predicate); double getAsDouble(); void ifPresent(DoubleConsumer consumer); boolean isPresent(); Optional<T> map(@NonNull DoubleFunction<T> mapper); double orElse(double other);  }### Answer:
@Test public void testIfPresent() { DoubleCollection collection = new DoubleArrayList(); OptionalDouble.of(2.0).ifPresent(collection::add); assertThat(collection).hasSize(1); assertThat(collection).contains(2.0); }