Why this produces one "1" and then is not terminating but going to infinite loop of no results?
Stream.of("x")
.flatMap(_x -> Stream.iterate(1, i -> i + 1))
.limit(1)
.forEach(System.out::println);
Why this produces one "1" and then is not terminating but going to infinite loop of no results?
Stream.of("x")
.flatMap(_x -> Stream.iterate(1, i -> i + 1))
.limit(1)
.forEach(System.out::println);