I have an ArrayList of custom objects. I want to remove duplicate entries.
The objects have three fields: title, subtitle, and id. If a su
title, subtitle
id
Another method using Java 8 streams you can also do pretty cool:
List CustomerLists; List unique = CustomerLists.stream().collect(collectingAndThen( toCollection(() -> new TreeSet<>(comparingLong(Customer::getId))), ArrayList::new));