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
You could just use a HashSet to maintain a collection of unique objects. If the Integer values in your map are important, then you can instead use the containsKey method of maps to test whether your key is already in the map.
Integer
containsKey