Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamToLoop/beforeInLambda.java
Tagir Valeev 7e1064ea3c [java-intentions] More preview tests; minor fixes
GitOrigin-RevId: 22a46c15d8900d8a31514846755a013f6a67ad42
2022-07-29 17:55:13 +00:00

20 lines
603 B
Java

// "Replace Stream API chain with loop" "true-preview"
import java.util.Objects;
import java.util.function.DoubleSupplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class Main {
public void test(String... list) {
DoubleSupplier s = () -> Stream.of(list)
.filter(Objects::nonNull)
.co<caret>llect(Collectors.averagingLong(String::length));
System.out.println(s.getAsDouble());
}
public static void main(String[] args) {
new Main().test("a", "bbb", null, "cc", "dd", "eedasfasdfs");
}
}