I have this code
Integer[] i = {1,3,4,6,7,43,2,1};
//create a predicate
Predicate<Integer> ini = value -> value > 10;;
//display-filter-and print the values in the collection
List<Integer> sss =Stream.of(i).peek(e -> System.out.println(e)).filter(ini).
peek(value -> System.out.println("After filter " + value)).collect(Collectors.toList());
//display the filtered list
System.out.println(sss);
And I'm getting this result
1
3
4
6
7
43
After filter 43
2
1
[43]
My question is why I'm getting the filter message in between in the middle of the peek statement? I tried this in different IDEs but I'm getting the same results.