I need to have a Set (HashSet) such that if I insert a pair (a, b) and if (b, a) is already in the set, the insertion would just be ignored. How to
(a, b)
(b, a)
Override the equals() and hashCode() methods of the Pair class to treat both (a,b) and (b,a) as equal.
equals()
hashCode()
Pair