How to create a list of unique/distinct objects (no duplicates) in Java?
Right now I am using HashMap to do this as the key is o
HashMap
HashSet (or) any Set implementation may does the job for you. Set don't allow duplicates.
HashSet
Set
Here is javadoc for HashSet.