docs: public void computeSignature(String requestMethod, GenericUrl requestUrl)
        throws GeneralSecurityException {
      OAuthSigner signer = this.signer;
      String signatureMethod = this.signatureMethod = signer.getSignatureMethod();
      // oauth_* parameters (except oauth_signature)
      SortedMultiset<Parameter> parameters = TreeMultiset.create();
      putParameterIfValueNotNull(parameters, "oauth_callback", callback);
      putParameterIfValueNotNull(parameters, "oauth_consumer_key", consumerKey);
      putParameterIfValueNotNull(parameters, "oauth_nonce", nonce);
      putParameterIfValueNotNull(parameters, "oauth_signature_method", signatureMethod);
      putParameterIfValueNotNull(parameters, "oauth_timestamp", timestamp);
      putParameterIfValueNotNull(parameters, "oauth_token", token);
      putParameterIfValueNotNull(parameters, "oauth_verifier", verifier);
      putParameterIfValueNotNull(parameters, "oauth_version", version);
      // parse request URL for query parameters
      for (Map.Entry<String, Object> fieldEntry : requestUrl.entrySet()) {
        Object value = fieldEntry.getValue();
        if (value != null) {
          String name = fieldEntry.getKey();
          if (value instanceof Collection<?>) {
            for (Object repeatedValue : (Collection<?>) value) {
              putParameter(parameters, name, repeatedValue);
            }
          } else {
            putParameter(parameters, name, value);
          }
        }
      }
      // normalize parameters
      StringBuilder parametersBuf = new StringBuilder();
      boolean first = true;
      for (Parameter parameter : parameters.elementSet()) {
        if (first) {
          first = false;
        } else {
          parametersBuf.append('&');
        }
        parametersBuf.append(parameter.getKey());
        String value = parameter.getValue();
        if (value != null) {
          parametersBuf.append('=').append(value);
        }
      }
      String normalizedParameters = parametersBuf.toString();
      // normalize URL, removing any query parameters and possibly port
      GenericUrl normalized = new GenericUrl();
      String scheme = requestUrl.getScheme();
      normalized.setScheme(scheme);
      normalized.setHost(requestUrl.getHost());
      normalized.setPathParts(requestUrl.getPathParts());
      int port = requestUrl.getPort();
      if ("http".equals(scheme) && port == 80 || "https".equals(scheme) && port == 443) {
        port = -1;
      }
      normalized.setPort(port);
      String normalizedPath = normalized.build();
      // signature base string
      StringBuilder buf = new StringBuilder();
      buf.append(escape(requestMethod)).append('&');
      buf.append(escape(normalizedPath)).append('&');
      buf.append(escape(normalizedParameters));
      String signatureBaseString = buf.toString();
      signature = signer.computeSignature(signatureBaseString);
    }