### Question:
KerberosPrincipalDescriptor extends AbstractKerberosDescriptor { @Override public Map<String, Object> toMap() { Map<String, Object> map = new TreeMap<>(); map.put(KEY_VALUE, getValue()); map.put(KEY_TYPE, KerberosPrincipalType.translate(getType())); map.put(KEY_CONFIGURATION, getConfiguration()); map.put(KEY_LOCAL_USERNAME, getLocalUsername()); return map; } KerberosPrincipalDescriptor(String principal, KerberosPrincipalType type, String configuration, String localUsername);  KerberosPrincipalDescriptor(Map<?, ?> data); String getValue(); void setValue(String value); KerberosPrincipalType getType(); void setType(KerberosPrincipalType type); String getConfiguration(); void setConfiguration(String configuration); String getLocalUsername(); void setLocalUsername(String localUsername); void update(KerberosPrincipalDescriptor updates); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object object);  }### Answer:
@Test public void testToMap() throws AmbariException { KerberosPrincipalDescriptor descriptor = createFromMap(); Assert.assertNotNull(descriptor); Assert.assertEquals(MAP_VALUE, descriptor.toMap()); }