@Test public void multiplePrincipalsTest() { SimplePrincipalCollection principalCollection = new SimplePrincipalCollection(); principalCollection.add("frank", "realm1"); principalCollection.add("johnny", "realm1"); principalCollection.add("Alberto", "realm2"); PrincipalCollection underTest = principalCollection; System.out.println(principalCollection); }
public void add(Object principal, String realmName) { if (realmName == null) { throw new NullPointerException("realmName argument cannot be null."); } if (principal == null) { throw new NullPointerException("principal argument cannot be null."); } this.cachedToString = null; getPrincipalsLazy(realmName).add(principal); }
SimplePrincipalCollection implements MutablePrincipalCollection { public void add(Object principal, String realmName) { if (realmName == null) { throw new NullPointerException("realmName argument cannot be null."); } if (principal == null) { throw new NullPointerException("principal argument cannot be null."); } this.cachedToString = null; getPrincipalsLazy(realmName).add(principal); } }
SimplePrincipalCollection implements MutablePrincipalCollection { public void add(Object principal, String realmName) { if (realmName == null) { throw new NullPointerException("realmName argument cannot be null."); } if (principal == null) { throw new NullPointerException("principal argument cannot be null."); } this.cachedToString = null; getPrincipalsLazy(realmName).add(principal); } SimplePrincipalCollection();  SimplePrincipalCollection(Object principal, String realmName);  SimplePrincipalCollection(Collection principals, String realmName);  SimplePrincipalCollection(PrincipalCollection principals); }
SimplePrincipalCollection implements MutablePrincipalCollection { public void add(Object principal, String realmName) { if (realmName == null) { throw new NullPointerException("realmName argument cannot be null."); } if (principal == null) { throw new NullPointerException("principal argument cannot be null."); } this.cachedToString = null; getPrincipalsLazy(realmName).add(principal); } SimplePrincipalCollection();  SimplePrincipalCollection(Object principal, String realmName);  SimplePrincipalCollection(Collection principals, String realmName);  SimplePrincipalCollection(PrincipalCollection principals); Object getPrimaryPrincipal(); void add(Object principal, String realmName); void addAll(Collection principals, String realmName); void addAll(PrincipalCollection principals); T oneByType(Class<T> type); Collection<T> byType(Class<T> type); List asList(); Set asSet(); Collection fromRealm(String realmName); Set<String> getRealmNames(); boolean isEmpty(); void clear(); Iterator iterator(); boolean equals(Object o); int hashCode(); String toString(); }
SimplePrincipalCollection implements MutablePrincipalCollection { public void add(Object principal, String realmName) { if (realmName == null) { throw new NullPointerException("realmName argument cannot be null."); } if (principal == null) { throw new NullPointerException("principal argument cannot be null."); } this.cachedToString = null; getPrincipalsLazy(realmName).add(principal); } SimplePrincipalCollection();  SimplePrincipalCollection(Object principal, String realmName);  SimplePrincipalCollection(Collection principals, String realmName);  SimplePrincipalCollection(PrincipalCollection principals); Object getPrimaryPrincipal(); void add(Object principal, String realmName); void addAll(Collection principals, String realmName); void addAll(PrincipalCollection principals); T oneByType(Class<T> type); Collection<T> byType(Class<T> type); List asList(); Set asSet(); Collection fromRealm(String realmName); Set<String> getRealmNames(); boolean isEmpty(); void clear(); Iterator iterator(); boolean equals(Object o); int hashCode(); String toString();  }