For example,
List<String> list1 = Arrays.asList("a", "b", "c","d");
List<String> list2 = Arrays.asList("a", "b", "e");
I want to remove all elements from list1 which are in list2, So what I did
list1.removeAll(List2);
return list1;
But I got UnsupportedOperationException.
So is there something that I making mistake or is there any method to use for such scenarios.