I tried the following snippet of Java 8 code with peek.
peek
List list = Arrays.asList(\"Bender\", \"Fry\", \"Leela\"); list.stream().p
From the docs on Stream for the peek method:
...additionally performing the provided action on each element as elements are consumed from the resulting stream.