question: public static EndpointDescription selectEndpoint ( EndpointDescription [ ] endpoints ) { if ( endpoints == null ) throw new IllegalArgumentException ( "null arg" ) ; endpoints = EndpointUtil . selectByProtocol ( endpoints , "opc.tcp" ) ; endpoints = EndpointUtil . selectByMessageSecurityMode ( endpoints , MessageSecurityMode . SignAndEncrypt ) ; if ( endpoints . length == 0 ) return null ; endpoints = EndpointUtil . sortBySecurityLevel ( endpoints ) ; EndpointUtil . reverse ( endpoints ) ; return endpoints [ 0 ] ; }
target:  Select the most suitable endpoint. <p> Selection uses the following precedence: 1) Protocol must be opc.tcp (as http is not implemented) 2) Security uses sign & encrypt 3) Select highest security level (determined by the server) 4) Prefer hostname over localhost 