While working on application where I want to discard duplicate entries for my value object (user defined VO), I used Set data structure by overriding hashCode(), equals() method.
I tried few iteration, it works fine but thing here I want to understand how uniqueness actually maintained? Is old object get replaced with new one or simply new one get ignore?
As they are identical how can I check above?
Thanks