@Test public void streamUsesValue() { assertThat(OptionalUtils.stream(Optional.of("Kevin")).count(), equalTo(1L)); }
public static <T> Stream<T> stream(Optional<T> value) { return value.map(Stream::of).orElseGet(Stream::empty); }
OptionalUtils { public static <T> Stream<T> stream(Optional<T> value) { return value.map(Stream::of).orElseGet(Stream::empty); } }
OptionalUtils { public static <T> Stream<T> stream(Optional<T> value) { return value.map(Stream::of).orElseGet(Stream::empty); } private  OptionalUtils(); }
OptionalUtils { public static <T> Stream<T> stream(Optional<T> value) { return value.map(Stream::of).orElseGet(Stream::empty); } private  OptionalUtils(); @SuppressWarnings("unchecked") static Optional<T> or(Optional<T> value, Supplier<Optional<? extends T>> supplier); static Stream<T> stream(Optional<T> value); static void ifPresentOrElse(Optional<T> value, Consumer<T> action, Runnable emptyAction); }
OptionalUtils { public static <T> Stream<T> stream(Optional<T> value) { return value.map(Stream::of).orElseGet(Stream::empty); } private  OptionalUtils(); @SuppressWarnings("unchecked") static Optional<T> or(Optional<T> value, Supplier<Optional<? extends T>> supplier); static Stream<T> stream(Optional<T> value); static void ifPresentOrElse(Optional<T> value, Consumer<T> action, Runnable emptyAction);  }