private List<String> checkRolesUsingDomains(List<RoleAssignmentEntry> roleAssignments,StringSet domains){
  List<String> matchingUsers=new ArrayList<String>();
  for (  RoleAssignmentEntry roleAssignment : roleAssignments) {
    String idOrGroup=!StringUtils.isEmpty(roleAssignment.getSubjectId()) ? roleAssignment.getSubjectId() : roleAssignment.getGroup();
    _log.debug("checking " + idOrGroup);
    String domain="";
    if (idOrGroup.lastIndexOf("@") != -1) {
      domain=idOrGroup.substring(idOrGroup.lastIndexOf("@") + 1);
    }
 else {
      continue;
    }
    for (    String domainToCheck : domains) {
      if (domainToCheck.equalsIgnoreCase(domain)) {
        matchingUsers.add(idOrGroup);
      }
    }
  }
  return matchingUsers;
}

private List < String > checkRolesUsingDomains ( List < RoleAssignmentEntry > roleAssignments , StringSet domains ) { List < String > matchingUsers = new ArrayList < String > ( ) ; for ( RoleAssignmentEntry roleAssignment : roleAssignments ) { String idOrGroup = ! StringUtils . isEmpty ( roleAssignment . getSubjectId ( ) ) ? roleAssignment . getSubjectId ( ) : roleAssignment . getGroup ( ) ; _log . debug ( "checking " + idOrGroup ) ; String domain = "" ; if ( idOrGroup . lastIndexOf ( "@" ) != - 1 ) { domain = idOrGroup . substring ( idOrGroup . lastIndexOf ( "@" ) + 1 ) ; } else { continue ; } for ( String domainToCheck : domains ) { if ( domainToCheck . equalsIgnoreCase ( domain ) ) { matchingUsers . add ( idOrGroup ) ; } } } return matchingUsers ; }
compare role assignments against domain ( s ) , return matching users .
