The teeing collector, available since Java 12 as Collectors::teeing, forwards its input to two other collectors before merging their results with a function.
Showing code for the most important Java 9 features: private interface methods, stream and optional APIs, collection factories, reactive streams, stack walking, multi-release JARs, redirected platform logging, unified logging, the module system, and more. If you're new to Java 9, start here.
How to repackage checked exceptions that get thrown in a Java stream pipeline so that they can be thrown without the compiler complaining about it.
With this talk, I help you get the most out of lambdas,
Optionals, and default methods, helping you master Java 8's core features
Articles about Java 8's streams often repeat a bunch of tropes: succinctness, ugly mechanics, anemic pipelines, weak exception handling. This is a rebuttal!
In Java 9 Stream gets a couple of new methods - one of them is an overload of
iterate that takes a predicate and returns a finite stream.
Java 9 is coming! One of the many changes are new Stream methods:
ofNullable. For more fun with streams!
Stream.findFirst() and findAny() work with any number of elements in the stream. Make sure to reduce(toOnlyElement()) if there should be at most one.
Another post about stream performance - this one implements your ideas about how else to approach the topic.
A close look at stream performance. How do they compare to for and for-each loops oder arrays and lists. And what role plays boxing?