### Question:
PersonCategory implements Comparable<PersonCategory> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } PersonCategory other = (PersonCategory) obj; if (key == null) { if (other.key != null) { return false; } } else if (!key.equals(other.key)) { return false; } return true; } PersonCategory(String name);  PersonCategory(String name, String key, int order); int getOrder(); void setOrder(int order); String getName(); void setKey(String key); String getKey(); boolean isOtherCategory(); void setUnderOrganizationalUnitExists(boolean underOrganizationalUnitExists); boolean isUnderOrganizationalUnitExists(); void setUnderPersonnsExists(boolean underPersonnsExists); boolean isUnderPersonnsExists(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(PersonCategory otherCategory);  }### Answer:
@Test public void equalityWithNullKey() throws Exception { PersonCategory secretary = new PersonCategory("Secretary", "secretary", 0); PersonCategory personnel = new PersonCategory("Personnel", null, 1); assertThat(secretary.equals(personnel), is(false)); }
@Test public void equality() throws Exception { PersonCategory firstSecretary = new PersonCategory("Secretary", "secretary", 0); PersonCategory secondSecretary = new PersonCategory("Secretary", "secretary", 1); assertThat(firstSecretary.equals(secondSecretary), is(true)); }