private void retainValidEntityIDs(Map map,String protocol,String realm) throws COTException {
  Set pSet=(Set)map.get(protocol);
  if ((pSet != null) && !pSet.isEmpty()) {
    Set entityIds=getAllEntities(realm,protocol);
    if ((entityIds == null) || entityIds.isEmpty()) {
      map.remove(protocol);
    }
 else {
      if (!entityIds.containsAll(pSet)) {
        if (entityIds.retainAll(pSet)) {
          if (debug.messageEnabled()) {
            debug.message("COTDescriptor.retainValidEntityIDs:" + " Following entity id: " + entityIds + " are valid and will be added to "+ "the circle of trust");
          }
          map.put(protocol,entityIds);
        }
      }
    }
  }
}

private void retainValidEntityIDs ( Map map , String protocol , String realm ) throws COTException { Set pSet = ( Set ) map . get ( protocol ) ; if ( ( pSet != null ) && ! pSet . isEmpty ( ) ) { Set entityIds = getAllEntities ( realm , protocol ) ; if ( ( entityIds == null ) || entityIds . isEmpty ( ) ) { map . remove ( protocol ) ; } else { if ( ! entityIds . containsAll ( pSet ) ) { if ( entityIds . retainAll ( pSet ) ) { if ( debug . messageEnabled ( ) ) { debug . message ( "COTDescriptor.retainValidEntityIDs:" + " Following entity id: " + entityIds + " are valid and will be added to " + "the circle of trust" ) ; } map . put ( protocol , entityIds ) ; } } } } }
retains only valid entity id for a specific protocol
