### Question:
KerberosIdentityDescriptor extends AbstractKerberosDescriptor { @Override public Map<String, Object> toMap() { Map<String, Object> dataMap = super.toMap(); if (reference != null) { dataMap.put(KEY_REFERENCE, reference); } if (principal != null) { dataMap.put(KEY_PRINCIPAL, principal.toMap()); } if (keytab != null) { dataMap.put(KEY_KEYTAB, keytab.toMap()); } if (when != null) { dataMap.put(KEY_WHEN, PredicateUtils.toMap(when)); } return dataMap; } 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 testToMap() throws AmbariException { KerberosIdentityDescriptor descriptor = createFromMap(); Assert.assertNotNull(descriptor); Assert.assertEquals(MAP_VALUE, descriptor.toMap()); }