A stateful lambda expression is one whose result depends on any state that might change during the execution of a pipeline. On the
other hand, a stateless lambda expression is one whose result does
not depend on any state that might change during the execution of a
pipeline.
It strongly recommended that you avoid stateful operations when using
parallel streams, so as to remove any potential data side effects. In
fact, they should generally be avoided in serial streams wherever
possible, since they prevent your streams from taking advantage of
parallelization.
Source: OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide: Exam 1Z0-809by Jeanne Boyarsky, Scott Selikoff
Possible Output: