### Question:
OptionalDouble { public OptionalDouble filter(@NonNull DoublePredicate predicate) { if (!optional.isPresent()) { return this; } return predicate.test(optional.getAsDouble()) ? this : empty(); } 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 testFilter() { assertThat(OptionalDouble.empty().filter(d -> d > 2.0).isPresent()).isFalse(); assertThat(OptionalDouble.of(2.0).filter(d -> d > 2.0).isPresent()).isFalse(); assertThat(OptionalDouble.of(3.0).filter(d -> d > 2.0).isPresent()).isTrue(); }