mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 03:07:47 +07:00
16 lines
441 B
Java
16 lines
441 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.Objects;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
|
|
public class Main {
|
|
public void test(String... list) {
|
|
System.out.println(Stream.of(list).filter(Objects::nonNull).col<caret>lect(Collectors.averagingDouble(s -> 1.0/s)));
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
new Main().test("a", "bbb", null, "cc", "dd", "eedasfasdfs");
|
|
}
|
|
}
|