I have written a class Person and overridden equals and hashcode methods. But while adding Person objects to HashSet I am able to add duplicates. So it seems my implementation of equals/hashcode is not correct.
Can someone please tell me where I am doing wrong?
At line 1 I am getting HashSet size as 4 instead of 3!!!