mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-19 10:20:56 +07:00
19 lines
422 B
Java
19 lines
422 B
Java
// "Replace Stream API chain with loop" "true-preview"
|
|
|
|
import java.util.Random;
|
|
import java.util.stream.IntStream;
|
|
|
|
public class Test {
|
|
static void test() {
|
|
IntStream.range(1, 100)
|
|
.filter(n -> n > 20)
|
|
.boxed()
|
|
.flatMapToDouble(n -> new Random(n).doubles(n))
|
|
.filter(n -> n < 0.01)
|
|
.fo<caret>rEach(System.out::println);
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
test();
|
|
}
|
|
} |