Negation should be inside filter
, since anyMatch
returns true if at least one match found
List<TestSVM> results = listOne.stream().filter(one-> !listTwo.stream()
.anyMatch(two -> two.getSchool().equals(one.getSchool())))
.collect(Collectors.toList());
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…