Hoping someone can explain why I cannot retrieve an element from a HashSet.
Consider my HashSet containing a list of MyHashObjects with their hashCode() and equals() methods overridden correctly.
What I was hoping to do was to construct a MyHashObject myself, and set the relevant hash code properties to certain values.
I can query the HashSet to see if there "equivalent" objects in the set using the contains() method.
So even though contains() returns true for the 2 objects, they may not be == true.
How come then there is no get() method similar to how the contains() works?
Interested to know the thinking behind this API decision