mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-19 10:20:56 +07:00
24 lines
677 B
Java
24 lines
677 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/*1*/./*2*/out/*3*/::/*4*/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")));
|
|
}
|
|
} |