code: public static void checkUriScheme(String scheme) {
      String uri = String.format("%s://null", scheme);
      try {
        new URI(uri);
      } catch (URISyntaxException e) {
        throw new IllegalArgumentException(e);
      }
    }
docs: Validates that an argument is a valid URI scheme.
  
  @param scheme The value to check.