Here you can find the source of streamInt(int max)
public static IntStream streamInt(int max)
//package com.java2s; //License from project: Open Source License import java.util.stream.IntStream; public class Main { public static IntStream streamInt(int max) { return streamInt(0, 1, max); }// ww w .j a va 2 s . co m public static IntStream streamInt(int start, int max) { return streamInt(start, 1, max); } public static IntStream streamInt(int start, int step, int max) { return IntStream.iterate(start, i -> i + step).limit(max - start); } }