I am trying to remove duplicates from a List of Custom Objects.
This is what I am doing:
Set<CustomObject> mySet = new Set<CustomObject>();
mySet.addAll(originalList); //OriginalList contains duplicate Custom Objects.
System.debug(mySet.size()); //This always prints the same size of the original list
I don't know what is wrong happening here, When I see the list of items using debug there are clearly two Objects with same details.
Anything am I missing??