Java – Removing duplicates in an ArrayList

Why not use a collection such as Set (and an implementation like HashSet) which naturally prevents duplicates?

Leave a Comment