mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
24 lines
657 B
Java
24 lines
657 B
Java
// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true"
|
|
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
|
|
public class Main {
|
|
private static void test(List<String> names) {
|
|
names.stream().filter(Objects::nonNull).fo<caret>rEach(System.out::println);
|
|
}
|
|
|
|
private static String getString() {
|
|
return "abc";
|
|
}
|
|
|
|
private static boolean testBound(List<String> strings) {
|
|
return strings.stream().anyMatch(getString()::equals);
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
test(Arrays.asList("a", "b", "xyz"));
|
|
System.out.println(testBound(Arrays.asList("a", "b", "c")));
|
|
}
|
|
} |