code: private void validateInput() {
          // Check for null values first.
          if (url == null) {
              throw new NullPointerException("URL should not be null");
          }
          if (!url.getProtocol().matches("^https?$")) {
              throw new IllegalArgumentException(
                      "URL protocol should be HTTP or HTTPS");
          }
          if (url.getRef() != null) {
              throw new IllegalArgumentException(
                      "URL should contain no reference");
          }
          if (url.getQuery() != null) {
              throw new IllegalArgumentException(
                      "URL should contain no query string");
          }
          if (handler == null) {
              throw new NullPointerException(
                      "Callback handler should not be null");
          }
      }
docs: Validates all the input to this client.