code: public static URI replaceHost(final URI uri, final String newHost, final boolean strict) throws URISyntaxException {
          final URI hostUri = newUri(newHost, strict);
          return newUri(uri.toString().replaceFirst(Pattern.quote(uri.getHost()),
                                                    Matcher.quoteReplacement(hostUri.getHost())), strict);
      }
docs: Returns a new URI with the host portion replaced by the new host portion
  
  @param uri the uri to replace the host in
  @param newHost the new host to replace with
  @param strict whether or not to perform strict escaping. (defaults to false)
  @return the new URI with everything the same except for the host being replaced
  @throws URISyntaxException if the newly-created URI is malformed.