mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-14 13:06:52 +07:00
16 lines
407 B
Java
16 lines
407 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
|
|
public class Test {
|
|
Stream<String> names() {
|
|
return Stream.of("foo", "bar");
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
List<String> list = new Test().names().map(String::trim).filter(n -> !n.isEmpty())
|
|
.<caret>collect(Collectors.toList());
|
|
}
|
|
} |