SyntaxFix
Write A Post
Hire A Developer
Questions
list1 = list1.stream().filter(str1-> list2.stream().map(x->x.getStr()).collect(Collectors.toSet()) .contains(str1)).collect(Collectors.toList());
This may work more efficient.