### Question:
TermAndZone implements Serializable, Comparable<TermAndZone> { @Override public boolean equals(Object o) { if (o instanceof TermAndZone) { return this.term.equals(((TermAndZone) o).term) && this.zone.equals(((TermAndZone) o).zone); } return false; } 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 testEquals() { String token = "Hello:World"; String otherToken = "term:zone"; TermAndZone uut = new TermAndZone(token); TermAndZone match = new TermAndZone(token); TermAndZone other = new TermAndZone(otherToken); Object obj = new Object(); Assert.assertTrue("Equals failed to recognize a matching instance", uut.equals(match)); Assert.assertFalse("Equals incorrectly matched different instance", uut.equals(other)); Assert.assertFalse("Equals incorrectly matched a non-instance", uut.equals(obj)); }