I want to iterate two lists and get new filtered list which will have values not present in second list. Can anyone help?
I have two lists - one is list of strings,
Doing it with streams is easy and readable:
Predicate notIn2 = s -> ! list2.stream().anyMatch(mc -> s.equals(mc.str)); List list3 = list1.stream().filter(notIn2).collect(Collectors.toList());