UserPrincipal extends Principal { public String getUsername() { return username; } UserPrincipal(String username, Collection<Permission> permissions, boolean admin); String getUsername(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String getType(); @Override String getName(); @Override boolean hasFullAccess(); List<String> getOwnerIds(); List<String> getOwnerKeys(); List<Owner> getOwners(); @Override boolean canAccess(Object target, SubResource subResource, Access access);  }
@Test public void usernameMatches() { assertEquals("icup", user.getUsername()); assertEquals(user.getUsername(), user.getPrincipalName()); }