@Beta
  public static LongStream stream(OptionalLong optional) {
    return optional.isPresent() ? LongStream.of(optional.getAsLong()) : LongStream.empty();
  }
@Beta
  public static LongStream stream(OptionalLong optional) {
    return optional.isPresent() ? LongStream.of(optional.getAsLong()) : LongStream.empty();
  }
@ Beta public static LongStream stream ( OptionalLong optional ) { return optional . isPresent ( ) ? LongStream . of ( optional . getAsLong ( ) ) : LongStream . 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.
If a value is present in { @code optional } returns a stream containing only that element otherwise returns an empty stream .