### Question:
KerberosIdentityDescriptor extends AbstractKerberosDescriptor { @Override public boolean equals(Object object) { if (object == null) { return false; } else if (object == this) { return true; } else if (object.getClass() == KerberosIdentityDescriptor.class) { KerberosIdentityDescriptor descriptor = (KerberosIdentityDescriptor) object; return super.equals(object) && ( (getReference() == null) ? (descriptor.getReference() == null) : getReference().equals(descriptor.getReference()) ) && ( (getPrincipalDescriptor() == null) ? (descriptor.getPrincipalDescriptor() == null) : getPrincipalDescriptor().equals(descriptor.getPrincipalDescriptor()) ) && ( (getKeytabDescriptor() == null) ? (descriptor.getKeytabDescriptor() == null) : getKeytabDescriptor().equals(descriptor.getKeytabDescriptor()) ) && ( (getWhen() == null) ? (descriptor.getWhen() == null) : getWhen().equals(descriptor.getWhen()) ); } else { return false; } } KerberosIdentityDescriptor(String name, String reference, KerberosPrincipalDescriptor principal, KerberosKeytabDescriptor keytab, Predicate when);  KerberosIdentityDescriptor(Map<?, ?> data); String getReference(); String getReferenceAbsolutePath(); void setReference(String reference); KerberosPrincipalDescriptor getPrincipalDescriptor(); void setPrincipalDescriptor(KerberosPrincipalDescriptor principal); KerberosKeytabDescriptor getKeytabDescriptor(); void setKeytabDescriptor(KerberosKeytabDescriptor keytab); Predicate getWhen(); void setWhen(Predicate when); boolean shouldInclude(Map<String, Object> context); void update(KerberosIdentityDescriptor updates); @Override Map<String, Object> toMap(); Optional<String> getReferencedServiceName(); boolean isShared(KerberosIdentityDescriptor that); boolean isReference(); @Override String getPath(); @Override int hashCode(); @Override boolean equals(Object object); List<KerberosIdentityDescriptor> findReferences();  }### Answer:
@Test public void testEquals() throws AmbariException { Assert.assertTrue(createFromJSON().equals(createFromJSON())); Assert.assertFalse(createFromJSON().equals(createFromMap())); }