Joe Soltzberg

60%
Flag icon
When programming with streams, it is not uncommon to find yourself with a Stream<Optional<T>> and to require a Stream<T> containing all the elements in the nonempty optionals in order to proceed. If you’re using Java 8, here’s how to bridge the gap: Click here to view code image streamOfOptionals     .filter(Optional::isPresent)     .map(Optional::get)
Effective Java
Rate this book
Clear rating
Open Preview