### Question:
Identifier implements Serializable { @Override public boolean equals(Object obj) { boolean result = false; if (obj == this) { result = true; } else if ((obj != null) && (getClass().equals(obj.getClass()))) { Identifier other = (Identifier) obj; EqualsBuilder eqbuilder = new EqualsBuilder(); eqbuilder.append(getRoot(), other.getRoot()); eqbuilder.append(getExtension(), other.getExtension()); result = eqbuilder.isEquals(); } return result; } Identifier(); @Override boolean equals(Object obj); String getAssigningAuthorityName(); String getExtension(); String getRoot(); @Override int hashCode(); void setAssigningAuthorityName(String assigningAuthority); void setExtension(String extension); void setRoot(String root);  }### Answer:
@Test public void equalsTest() throws Exception { Identifier id1 = new Identifier(); id1.setRoot("555"); id1.setExtension("555"); assertTrue(id1.equals(id1)); assertEquals(id1, id1); Identifier id2 = new Identifier(); id2.setRoot("555"); id2.setExtension("555"); assertTrue(id1.equals(id1)); assertEquals(id1, id2); id1.setExtension(null); id2.setExtension(null); assertEquals(id1, id2); id2.setRoot("556"); assertFalse(id1.equals(id2)); assertFalse(id1.equals(null)); assertFalse(id1.equals(new Identifier())); }