mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
17 lines
370 B
Java
17 lines
370 B
Java
// "Collapse loop with stream 'collect()'" "true-preview"
|
|
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Test {
|
|
MyObj test(List<String> list) {
|
|
List<String> res = list.stream().filter(s -> !s.isEmpty()).collect(Collectors.toList());
|
|
return new MyObj(res);
|
|
}
|
|
|
|
private class MyObj {
|
|
public MyObj(List<String> res) {
|
|
}
|
|
}
|
|
}
|