List of usage examples for java.util.stream LongStream limit
LongStream limit(long maxSize);
From source file:Main.java
public static void main(String[] args) { LongStream b = LongStream.of(1L, 2L, Long.MAX_VALUE, Long.MIN_VALUE); b.limit(2).forEach(System.out::println); }
From source file:Main.java
public static void main(String[] args) { LongStream b = LongStream.generate(() -> { return 2L; });/*from w ww . j a v a 2 s . c o m*/ b.limit(10).forEach(System.out::println); }
From source file:Main.java
public static void main(String[] args) { LongStream b = LongStream.iterate(1, (n) -> { return n + 1; });//ww w . java2 s . co m b.limit(10).forEach(System.out::println); }