RecapDifficulty: Advanced1 min

Recap: Streams

Laziness, pulling one element at a time, map and flatMap, collectors, single use and parallel cost.

Streams come down to the six ideas below, each listed with the card that covers it.

What the topic established, and which card it was on
The ideaWhere
Intermediate operations describe; terminal operations runStream Laziness: Intermediate and Terminal Operations
The terminal operation pulls one element at a time through the whole chainStream Laziness Walkthrough: One Element at a Time Through the Chain
map gives one value per element; flatMap flattens several into one streammap vs flatMap
collect and groupingBy decide the shape at the endCollectors: Ending a Stream in a List, a Set or a Map
A stream holds a way of pulling elements, so it cannot be run twiceWhy a Stream Cannot Be Used Twice
Parallel costs splitting and combining before it saves anythingParallel Streams: Why parallel() Can Make a Pipeline Slower

A pipeline is a description of work, pulled by its last line. Nothing happening, a stream that will not run twice, and three hundred elements touched out of a thousand are all that one fact showing through.