blob: f7e3c9d55f607b5bfb774fb6198e6a47ca20dfa9 [file]
// "Fix all 'Stream API call chain can be simplified' problems in file" "true"
import java.util.*;
class Test {
public void test(List<String> list, Set<String> set, Iterable<String> it) {
if(list.stream().al<caret>lMatch(set::contains)) {
System.out.println("all matched");
}
if(set.stream().allMatch(x -> list.contains(x))) {
System.out.println("all matched");
}
if(set.stream()./*one*/allMatch(((Collection<String>/*two*/)it)::contains)) {
System.out.println("all matched");
}
}
static class MyList extends ArrayList<String> {
@Override
public boolean containsAll(Collection<?> c) {
// do not replace when this-reference is used as infinite recursion might be produced
return c.stream().allMatch(this::contains);
}
}
}