WebloungeUserImpl extends UserImpl implements WebloungeUser { public String getName() { if (name != null) return name; if (cachedName != null) return cachedName; String first = getFirstName(); String last = getLastName(); if (StringUtils.trimToNull(first) == null && StringUtils.trimToNull(last) == null) return null; StringBuffer name = new StringBuffer(); if (StringUtils.trimToNull(first) != null) { name.append(first); } if (StringUtils.trimToNull(last) != null) { if (name.length() > 0) name.append(" "); name.append(last); } cachedName = name.toString(); return cachedName; } WebloungeUserImpl(String login, String realm);  WebloungeUserImpl(String login); boolean isEnabled(); boolean canLogin(); void setEnabled(boolean enabled); void setFirstName(String firstname); String getFirstName(); void setLastName(String lastname); String getLastName(); String getName(); void setEmail(String email); String getEmail(); void setLanguage(Language language); Language getLanguage(); String getInitials(); void setInitials(String initials); void setLastLogin(Date date, String src); Date getLastLogin(); String getLastLoginFrom(); @Override String getChallenge(); @Override void setChallenge(String challenge); @Override byte[] getResponse(); @Override void setResponse(byte[] response, DigestType digest); Object getProperty(String name); Object removeProperty(String name); void setProperty(String name, Object value); static WebloungeUserImpl fromXml(Node userNode, Site site); static WebloungeUserImpl fromXml(Node userNode, Site site, XPath xpath); String toXml(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testSetName() { String name = "James Joyce"; user.setName(name); assertEquals(name, user.getName()); }
@Test public void testGetName() { String name = firstname + " " + lastname; assertEquals(name, user.getName()); }