I have the following sample code:
System.out.println( \"Result: \" + Stream.of(1, 2, 3) .filter(i -> {
Unfortunately .flatMap() is not lazy. However, a custom flatMap workaround is available here: Why .flatMap() is so inefficient (non lazy) in java 8 and java 9
.flatMap()
flatMap