guava/src/com/google/common/collect/Streams.java
@Beta
  public static DoubleStream stream(OptionalDouble optional) {
    return optional.isPresent() ? DoubleStream.of(optional.getAsDouble()) : DoubleStream.empty();
  }
@Beta
  public static DoubleStream stream(OptionalDouble optional) {
    return optional.isPresent() ? DoubleStream.of(optional.getAsDouble()) : DoubleStream.empty();
  }
If a value is present in {@code optional}, returns a stream containing only that element,
otherwise returns an empty stream.

<p><b>Java 9 users:</b> use {@code optional.stream()} instead.