@@ -0,0 +1,694 @@
+package com.winterbe.java8;%0A%0Aimport java.security.SecureRandom;%0Aimport java.util.Arrays;%0Aimport java.util.stream.IntStream;%0A%0A/**%0A * @author Benjamin Winterberg%0A */%0Apublic class Streams13 %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        SecureRandom secureRandom = new SecureRandom(new byte%5B%5D%7B1, 3, 3, 7%7D);%0A        int%5B%5D randoms = IntStream.generate(secureRandom::nextInt)%0A                .filter(n -%3E n %3E 0)%0A                .limit(10)%0A                .toArray();%0A        System.out.println(Arrays.toString(randoms));%0A%0A%0A        int%5B%5D nums = IntStream.iterate(1, n -%3E n * 2)%0A                .limit(11)%0A                .toArray();%0A        System.out.println(Arrays.toString(nums));%0A    %7D%0A%7D%0A

Add sample for infinite streams