### Question:
KerberosKeytabDescriptor extends AbstractKerberosDescriptor { @Override public Map<String, Object> toMap() { Map<String, Object> map = new TreeMap<>(); String data; data = getFile(); map.put(KEY_FILE, data); Map<String, String> owner = new TreeMap<>(); data = getOwnerName(); if (data != null) { owner.put(KEY_ACL_NAME, data); } data = getOwnerAccess(); if (data != null) { owner.put(KEY_ACL_ACCESS, data); } if (!owner.isEmpty()) { map.put(KEY_OWNER, owner); } Map<String, String> group = new TreeMap<>(); data = getGroupName(); if (data != null) { group.put(KEY_ACL_NAME, data); } data = getGroupAccess(); if (data != null) { group.put(KEY_ACL_ACCESS, data); } if (!group.isEmpty()) { map.put(KEY_GROUP, group); } data = getConfiguration(); if (data != null) { map.put(KEY_CONFIGURATION, data); } return map; } KerberosKeytabDescriptor(String file, String ownerName, String ownerAccess, String groupName,
                                  String groupAccess, String configuration, boolean cachable);  KerberosKeytabDescriptor(Map<?, ?> data); String getFile(); void setFile(String file); String getOwnerName(); void setOwnerName(String name); String getOwnerAccess(); void setOwnerAccess(String access); String getGroupName(); void setGroupName(String name); String getGroupAccess(); void setGroupAccess(String access); String getConfiguration(); void setConfiguration(String configuration); boolean isCachable(); void setCachable(boolean cachable); void update(KerberosKeytabDescriptor updates); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object object);  }### Answer:
@Test public void testToMap() throws AmbariException { KerberosKeytabDescriptor descriptor = createFromMap(); Assert.assertNotNull(descriptor); Assert.assertEquals(MAP_VALUE, descriptor.toMap()); }