### Question:
Persona extends BaseEntity implements Externalizable { public Map<String, String> toAliasValueMap() { Map<String, String> ret = new HashMap<String, String>(); if (getNickname() != null) { ret.put("nickname", getNickname()); } if (getEmail() != null) { ret.put("email", getEmail()); } if (getFullname() != null) { ret.put("fullname", getFullname()); } if (getDob() != null) { ret.put("dob", getDob()); } if (getGender() != null) { ret.put("gender", getGender()); } if (getPostcode() != null) { ret.put("postcode", getPostcode()); } if (getCountry() != null) { ret.put("country", getCountry()); } if (getLanguage() != null) { ret.put("language", getLanguage()); } if (getTimezone() != null) { ret.put("timezone", getTimezone()); } return ret; } Persona();  Persona(final User user); User getUser(); void setUser(final User user); String getCountry(); void setCountry(final String country); String getDob(); void setDob(final String dob); String getEmail(); void setEmail(final String email); String getFullname(); void setFullname(final String fullname); String getGender(); void setGender(final String gender); String getLanguage(); void setLanguage(final String language); String getName(); void setName(final String name); String getNickname(); void setNickname(final String nickname); String getPostcode(); void setPostcode(final String postcode); String getTimezone(); void setTimezone(final String timezone); Set<Attribute> getAttributes(); void setAttributes(final Set<Attribute> attributes); void addAttribute(final Attribute attribute); void clearAttributes(); void setLocale(final Locale locale); Locale getLocale(); Attribute getAttributeByAlias(String alias); Attribute getAttributeByType(String type); Map<String, String> toAliasValueMap(); Map<String, String> toTypeValueMap(); @Override int hashCode(); @Override boolean equals(final Object obj); void readExternal(ObjectInput in); void writeExternal(ObjectOutput out);  }### Answer:
@Test public void testToAliasValueMap() { Persona persona = new Persona(); persona.setNickname("My Nickname"); Map<String, String> actual = persona.toAliasValueMap(); Map<String, String> expected = new HashMap<String, String>(); expected.put("nickname", "My Nickname"); assertEquals(expected, actual); }