I tried the following snippet of Java 8 code with peek
.
List list = Arrays.asList(\"Bender\", \"Fry\", \"Leela\");
list.stream().p
Streams in Java-8 are lazy, in addition, say if there are two chained operations in stream one after the other, then the second operation begins as soon as first one finishes processing a unit of data element (given there is a terminal operation in the stream).
This is the reason why you can see repeated name strings getting output.