Here you can find the source of infiniteParallelStream()
public static LongStream infiniteParallelStream()
//package com.java2s; //License from project: Open Source License import java.util.stream.LongStream; import static java.util.stream.LongStream.iterate; public class Main { /**/*from w w w. java2 s. c om*/ * Creates an infinite parallel long stream. * * @return An infinite stream */ public static LongStream infiniteParallelStream() { return iterate(1L, l -> l + 1).parallel(); } }