code: @Beta
    public static IntStream stream(OptionalInt optional) {
      return optional.isPresent() ? IntStream.of(optional.getAsInt()) : IntStream.empty();
    }
docs: 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.