mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
15 lines
455 B
Java
15 lines
455 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.IntSummaryStatistics;
|
|
import java.util.function.Supplier;
|
|
import java.util.stream.Stream;
|
|
|
|
public class Main {
|
|
private static IntSummaryStatistics test() {
|
|
return Stream.<Supplier<Integer>>of(() -> 1, /*between*/ () /*supply 2*/ -> 2, () -> 3).mapToInt(sup -> sup.get()).summar<caret>yStatistics();
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(test());
|
|
}
|
|
} |