PhenoGridMatchTaxon { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final PhenoGridMatchTaxon other = (PhenoGridMatchTaxon) obj; if (!Objects.equals(this.id, other.id)) { return false; } return Objects.equals(this.label, other.label); } PhenoGridMatchTaxon(String id, String label); String getId(); String getLabel(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testEquals() { PhenoGridMatchTaxon other = new PhenoGridMatchTaxon(id, label); assertThat(instance, equalTo(other)); }
@Test public void testNotEqualsOtherClass() { String other = "Homo sapiens"; assertThat(instance.equals(other), is(false)); }