### Question:
PairOfStrings implements WritableComparable<PairOfStrings> { public boolean equals(Object obj) { PairOfStrings pair = (PairOfStrings) obj; return leftElement.equals(pair.getLeftElement()) && rightElement.equals(pair.getRightElement()); } 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 testComparison2() throws IOException { WritableComparator comparator = new PairOfStrings.Comparator(); PairOfStrings pair1 = new PairOfStrings("hi", "there"); PairOfStrings pair2 = new PairOfStrings("hi", "there"); PairOfStrings pair3 = new PairOfStrings("hi", "howdy"); PairOfStrings pair4 = new PairOfStrings("a", "howdy"); PairOfStrings pair5 = new PairOfStrings("hi", "z"); assertTrue(pair1.equals(pair2)); assertFalse(pair1.equals(pair3)); assertTrue(WritableComparatorTestHarness.compare(comparator, pair1, pair2) == 0); assertTrue(WritableComparatorTestHarness.compare(comparator, pair1, pair3) > 0); assertTrue(WritableComparatorTestHarness.compare(comparator, pair1, pair4) > 0); assertTrue(WritableComparatorTestHarness.compare(comparator, pair1, pair5) < 0); assertTrue(WritableComparatorTestHarness.compare(comparator, pair3, pair4) > 0); assertTrue(WritableComparatorTestHarness.compare(comparator, pair4, pair5) < 0); }