I have a question about the following two codes.
Without parallelism:
Stream.of(1, 2, 3)
.peek(System.out::println)
.skip(1)
.map(n-> n * 10)
.forEach(System.out::println);
The output is:
1
2
20
3
30
With parallelism:
Stream.of(1, 2, 3)
.parallel()
.peek(System.out::println)
.skip(1)
.map(n-> n * 10)
.forEach(System.out::println);
Output is:
2
3
20
30
Why does the output of the parallel stream not include 1?