List<Integer> result = Stream.of(3, 1, 4, 1, 5, 9, 2, 6)
.peek(x -> System.out.println("1) " + x))
.filter(n -> n > 2)
.peek(x -> System.out.println("2) " + x))
.sorted()
.peek(x -> System.out.println("3) " + x))
.limit(3)
.peek(x -> System.out.println("4) " + x))
.collect(Collectors.toList());
System.out.println("Финальный результат: " + result);