SyntaxFix
Write A Post
Hire A Developer
Questions
This is possible in Java 9.
Stream.generate(() -> null) .takeWhile(x -> iterator.hasNext()) .map(n -> iterator.next()) .forEach(System.out::println);