Files
2022-12-23 13:26:29 +00:00

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() {}
}