### Question:
PairOfStrings implements WritableComparable<PairOfStrings> { public int hashCode() { return Objects.hash(leftElement, rightElement); } PairOfStrings();  PairOfStrings(String left, String right); void readFields(DataInput in); void write(DataOutput out); String getLeftElement(); String getRightElement(); String getKey(); String getValue(); void set(String left, String right); boolean equals(Object obj); int compareTo(PairOfStrings pair); int hashCode(); String toString(); PairOfStrings clone();  }### Answer:
@Test public void testHashCode() throws IOException { PairOfStrings pair1 = new PairOfStrings("hi", "there"); PairOfStrings pair2 = new PairOfStrings("there", "hi"); PairOfStrings pair3 = new PairOfStrings("hello", "world"); HashSet<PairOfStrings> hash = new HashSet<PairOfStrings>(); assertTrue(hash.add(pair1)); assertFalse(hash.add(pair1)); assertTrue(hash.add(pair2)); assertFalse(hash.add(pair2)); assertTrue(hash.add(pair3)); assertTrue(hash.remove(pair3)); assertTrue(hash.remove(pair1)); assertTrue(hash.remove(pair2)); }