Browse Oracle Certification Guides

1Z0-829 Java 17 Streams, Collectors, and Optional Guide

Study 1Z0-829 Java 17 Streams, Collectors, and Optional: key concepts, common traps, and exam decision cues.

Stream questions are rarely about memorizing one method name. They are about predicting how the full pipeline behaves under the actual contract of each stage.

Stream-choice map

If the requirement is mainly about… Better first instinct
transform elements map or flatMap lane
keep only some elements filter lane
produce grouped or reduced result collector or reduction choice matters
absent value handling Optional contract matters
speed parallel only if order and shared-state assumptions still hold

What the exam is really testing

If the code shows… Strong reading
no terminal operation laziness is likely the point
second terminal use on the same stream stream reuse is illegal
Optional.orElse(...) vs orElseGet(...) eager vs lazy behavior may matter
parallel stream with shared state correctness risk matters before speed

Common traps

Trap Better rule
assuming intermediate operations execute immediately streams are lazy until terminal use
reusing an already-consumed stream a stream pipeline is one-shot
treating Optional like a collection it models presence or absence, not multiplicity
assuming parallel always means better order and shared-state design can make it wrong

Quiz

Loading quiz…
Revised on Sunday, May 10, 2026