`toMap` builds a `Map<K, V>` from a stream. The 3-arg form takes a merge function for handling duplicate keys — without it, duplicates throw IllegalStateException.
`Optional::stream` (Java 9+) bridges optionals into the Stream API — collect all the `Some` values from a list of optionals, drop the empties, in one pipeline.
Java Collectors.partitioningBy — Split by Predicate
Special case of groupingBy when the key is boolean — returns a `Map<Boolean, List<T>>` for the "true" and "false" buckets. Slightly more efficient than groupingBy.
Build streams from a seed + a function. `generate(supplier)` calls the supplier each time; `iterate(seed, next)` applies a unary op. Always pair with `limit` to bound them.
The fluent pipeline for transforming collections. `filter` keeps matching elements, `map` transforms each one, `collect(toList())` materializes the result.
`reduce` collapses a stream to one value: sum, product, max, min, custom accumulation. Two-arg form needs an identity (zero/seed); three-arg form supports parallel streams via a combiner.
Map each element to a Stream, then concatenate all of them into one. Used everywhere from "all words from a list of sentences" to "all permissions from a list of roles".