Java IntStream create from generator function
import java.util.stream.IntStream; public class Main { public static void main(String[] args) { IntStream.generate(() -> 99) .limit(10)//from w w w . jav a2 s .c o m .forEach(System.out::println); } }