public static EndpointDescription[] selectByMessageSecurityMode(EndpointDescription[] searchSet,MessageSecurityMode mode){
  List<EndpointDescription> result=new ArrayList<EndpointDescription>();
  for (  EndpointDescription d : searchSet)   if (d.getSecurityMode() == mode)   result.add(d);
  return result.toArray(new EndpointDescription[result.size()]);
}

public static EndpointDescription [ ] selectByMessageSecurityMode ( EndpointDescription [ ] searchSet , MessageSecurityMode mode ) { List < EndpointDescription > result = new ArrayList < EndpointDescription > ( ) ; for ( EndpointDescription d : searchSet ) if ( d . getSecurityMode ( ) == mode ) result . add ( d ) ; return result . toArray ( new EndpointDescription [ result . size ( ) ] ) ; }
selects all endpoints that conform to given message security mode
