docs: public static URI toUri(String endpoint, Protocol protocol) {
          if (endpoint == null) {
              throw new IllegalArgumentException("endpoint cannot be null");
          }
  
          /*
           * If the endpoint doesn't explicitly specify a protocol to use, then
           * we'll defer to the default protocol specified in the client
           * configuration.
           */
          if (!endpoint.contains("://")) {
              endpoint = protocol.toString() + "://" + endpoint;
          }
  
          try {
              return new URI(endpoint);
          } catch (URISyntaxException e) {
              throw new IllegalArgumentException(e);
          }
      }