question: static Map trustedProviderSetToEntityIDMap ( Set providerSet , String realm ) { if ( ( providerSet == null ) || providerSet . isEmpty ( ) ) { return Collections . EMPTY_MAP ; } Map map = new HashMap ( ) ; Iterator it = providerSet . iterator ( ) ; while ( it . hasNext ( ) ) { String val = ( String ) it . next ( ) ; if ( debug . messageEnabled ( ) ) { debug . message ( "COTUtils.setToEntityIDMap: check " + val ) ; } if ( val . endsWith ( SAML2_DELIM ) ) { Set set = new HashSet ( ) ; set . add ( COTConstants . SAML2 ) ; map . put ( val . substring ( 0 , val . length ( ) - SAML2_DELIM . length ( ) ) , set ) ; } else if ( val . endsWith ( IDFF_DELIM ) ) { Set set = new HashSet ( ) ; set . add ( COTConstants . IDFF ) ; map . put ( val . substring ( 0 , val . length ( ) - IDFF_DELIM . length ( ) ) , set ) ; } else if ( val . endsWith ( WSFED_DELIM ) ) { Set set = new HashSet ( ) ; set . add ( COTConstants . WS_FED ) ; map . put ( val . substring ( 0 , val . length ( ) - WSFED_DELIM . length ( ) ) , set ) ; } else { Set protocolSet = findProtocolsForEntity ( val , realm ) ; if ( ( protocolSet != null ) && ! protocolSet . isEmpty ( ) ) { map . put ( val , protocolSet ) ; } } } if ( debug . messageEnabled ( ) ) { debug . message ( "COTUtils.setToEntityIDMap: return " + map ) ; } return map ; }
target:  Converts set of COT trusted providers to map. Key of the map is the entity id name, value is a set of protocols the entity supports.