Adding hashcode and equals methods to the Pair