### Question:
OptionalDouble { public <T> Optional<T> map(@NonNull DoubleFunction<T> mapper) { return optional.isPresent() ? Optional.ofNullable(mapper.apply(optional.getAsDouble())) : Optional.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 testMap() { assertThat(OptionalDouble.empty().map(d -> 1)).isEmpty(); assertThat(OptionalDouble.of(2.0).map(d -> 1)).hasValue(1); }