### Question:
TermAndZone implements Serializable, Comparable<TermAndZone> { @Override public int compareTo(TermAndZone o) { int comparison = this.zone.compareTo(o.zone); if (comparison == 0) { comparison = this.term.compareTo(o.term); } return comparison; } TermAndZone(String token);  TermAndZone(String term, String zone); String getToken(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object o); @Override int compareTo(TermAndZone o); public String zone; public String term; }### Answer:
@Test public void testCompare() { String token = "Hello:World"; String lessZonetoken = "Hello:world"; String greaterZonetoken = "Hello:WORLD"; String lessTermToken = "term:World"; String greaterTermToken = "Ello:World"; TermAndZone uut = new TermAndZone(token); TermAndZone match = new TermAndZone(token); TermAndZone lessZone = new TermAndZone(lessZonetoken); TermAndZone greaterZone = new TermAndZone(greaterZonetoken); TermAndZone lessTerm = new TermAndZone(lessTermToken); TermAndZone greaterTerm = new TermAndZone(greaterTermToken); Assert.assertTrue("CompareTo failed to recognize a matching instance.", (0 == uut.compareTo(match))); Assert.assertTrue("CompareTo failed to recognize an instance containing a less than Zone value.", (0 > uut.compareTo(lessZone))); Assert.assertTrue("CompareTo failed to recognize an instance containing a less than Term value.", (0 > uut.compareTo(lessTerm))); Assert.assertTrue("CompareTo failed to recognize an instance containing a greater than Zone value.", (0 < uut.compareTo(greaterZone))); Assert.assertTrue("CompareTo failed to recognize an instance containing a greater than Term value.", (0 < uut.compareTo(greaterTerm))); }