IntStream.range(1,100).peek(Demo6::debug).count();
public static void debug(int i) {
System.out.println(Thread.currentThread().getName() + " " + " debug " + i);
try {
TimeUnit.SECONDS.sleep(3);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
jdk10运行不会产生结果,8就没有问题