public static URI createUriFromServerSet(Set<InetSocketAddress> serverInetSet,String path,String protocol) throws URISyntaxException {
  InetSocketAddress inetSocketAddress=ServiceUtils.selectRandomItem(serverInetSet);
  String address=inetSocketAddress.getHostString();
  int port=inetSocketAddress.getPort();
  URI uri=new URI(protocol,null,address,port,path,null,null);
  return uri;
}

public static URI createUriFromServerSet ( Set < InetSocketAddress > serverInetSet , String path , String protocol ) throws URISyntaxException { InetSocketAddress inetSocketAddress = ServiceUtils . selectRandomItem ( serverInetSet ) ; String address = inetSocketAddress . getHostString ( ) ; int port = inetSocketAddress . getPort ( ) ; URI uri = new URI ( protocol , null , address , port , path , null , null ) ; return uri ; }
returns the uri of a random server .
