public void addRoleMapping(String role, Collection principals) throws PolicyContextException {
Iterator iter = principals.iterator();
while (iter.hasNext()) {
Principal principal = (Principal) iter.next();
if (!(principal instanceof RealmPrincipal)) throw new PolicyContextException("Principal not instance of RealmPrincipal");
HashSet roles = (HashSet) principalRoleMapping.get(principal);
if (roles == null) {
roles = new HashSet();
principalRoleMapping.put(principal, roles);