Streams in Java 8
Since Java 8 the JDK has a Stream API. Among numerous other operations the Stream API offers two operations – reduce() and collect() – which are occasionally misunderstood and thus used incorrectly – at the expense of introducing subtle bugs in conjunction with parallel streams.