code: public static URI removeServer(URI uri) {
          try {
              return new URI(null, null, null, -1, uri.getPath(), uri.getQuery(), uri.getFragment());
          } catch (URISyntaxException e) {
              throw new InvalidUriException(e);
          }
  
      }
docs: Removes the server information frome a {@link URI}.
  
  @param uri
  the {@link URI}
  @return a new {@link URI} with no scheme, host and port