code: public static URI appendUri(URI baseUri, String... pathComponents) {
          StringBuilder builder = new StringBuilder(baseUri.toASCIIString());
          for (String path : pathComponents) {
              if (path != null && path.length() > 0) {
                  path = normalizePath(path);
                  if (path.startsWith("/")) {
                      if (builder.charAt(builder.length() - 1) == '/') {
                          builder.setLength(builder.length() - 1);
                      }
                  } else {
                      if (builder.charAt(builder.length() - 1) != '/') {
                          builder.append('/');
                      }
                  }
                  builder.append(path);
              }
          }
          try {
              return new URI(builder.toString());
          } catch (URISyntaxException e) {
              throw new RuntimeException("Unexpected error", e);
          }
      }
docs: Append the given path to the given baseUri.
  
  <p>
  This method will encode the given path but not the given baseUri.
  
  @param baseUri
  @param pathComponents