mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-25 19:21:16 +07:00
25 lines
641 B
Java
25 lines
641 B
Java
// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true"
|
|
|
|
import java.lang.reflect.Array;
|
|
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());
|
|
}
|
|
|
|
private long counter(Class<? extends Array> list) {
|
|
return stream(list).count();
|
|
}
|
|
|
|
public <E> Stream<E> stream(Class<E> clazz) {
|
|
return null;
|
|
}
|
|
} |