compare three list and remove duplicates in java 8 code example
Example 1: compare two lists and remove duplicates java
listA.removeAll(new HashSet(listB));
Example 2: remove duplicates from list java
ArrayList<Object> withDuplicateValues;
HashSet<Object> withUniqueValue = new HashSet<>(withDuplicateValues);
withDuplicateValues.clear();
withDuplicateValues.addAll(withUniqueValue);