I have created a Class
I am using this object in Arraylist and sorting the list based on this. Then i am adding the list of this objects(List<ClassA>

to HashSet, Then i am populating another List<ClassA> if it is not there in hashset.
The question here is should i have to implement equals and hashcode methods in ClassA. If so caan anyone give an efficient equal and hashcode impl code.
Thanks in advance