mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-05 17:47:53 +07:00
GitOrigin-RevId: c4db6507c258e5611f6d47b9373a0c2531802345
15 lines
306 B
Java
15 lines
306 B
Java
// "Collapse loop with stream 'forEach()'" "true-preview"
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
|
|
class Sample {
|
|
List<String> foo = new ArrayList<>();
|
|
String foo(){
|
|
foo.stream().filter(Objects::isNull).forEach(s -> bar());
|
|
return null;
|
|
}
|
|
|
|
bar() {}
|
|
}
|