mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-27 05:20:54 +07:00
16 lines
433 B
Java
16 lines
433 B
Java
// "Replace Stream API chain with loop" "true-preview"
|
|
|
|
import java.util.List;
|
|
import java.util.function.LongSupplier;
|
|
|
|
public class Main {
|
|
private static void test(List<String> list) {
|
|
long count = list.stream(). // and filter!
|
|
filter(s -> !s/* comment */.isEmpty()).co<caret>unt();
|
|
if(count > 10) {
|
|
LongSupplier sup = () -> count*2;
|
|
long result = sup.get();
|
|
System.out.println(result);
|
|
}
|
|
}
|
|
} |