If nothing in the pipeline can change the element count, count() answers from the source's size and never executes the stages. A peek used for logging or a counter then reports zero, which looks like the feed was empty.
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-09-20