Tagged in

Stream

Javarevisited
Javarevisited
A humble place to learn Java and Programming better.
More information
Followers
24K
Elsewhere
More, on Medium

Debugging Streams with Peek

I blogged about Java Stream debugging in the past but I skipped an important method that’s worthy of a post of…


Non terminal operation peek() in Java8

In Java 8, the peek method is a non-terminal operation that allows you to perform an action on each element of a stream as it passes through the pipeline. It can be useful for debugging or logging, or for performing some kind of side effect on the stream…