mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 11:36:59 +07:00
14 lines
355 B
Java
14 lines
355 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.OptionalDouble;
|
|
import java.util.stream.IntStream;
|
|
|
|
public class Main {
|
|
private static OptionalDouble test(int... numbers) {
|
|
return IntStream.of(numbers).filter(x -> x > 0).aver<caret>age();
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(test(-1,-2,-3));
|
|
}
|
|
} |