docs: public RequestTemplate resolve(Map<String, ?> variables) {
  
      StringBuilder uri = new StringBuilder();
  
      /* create a new template form this one, but explicitly */
      RequestTemplate resolved = RequestTemplate.from(this);
  
      if (this.uriTemplate == null) {
        /* create a new uri template using the default root */
        this.uriTemplate = UriTemplate.create("", !this.decodeSlash, this.charset);
      }
  
      uri.append(this.uriTemplate.expand(variables));
  
      /*
       * for simplicity, combine the queries into the uri and use the resulting uri to seed the
       * resolved template.
       */
      if (!this.queries.isEmpty()) {
        /*
         * since we only want to keep resolved query values, reset any queries on the resolved copy
         */
        resolved.queries(Collections.emptyMap());
        StringBuilder query = new StringBuilder();
        Iterator<QueryTemplate> queryTemplates = this.queries.values().iterator();
  
        while (queryTemplates.hasNext()) {
          QueryTemplate queryTemplate = queryTemplates.next();
          String queryExpanded = queryTemplate.expand(variables);
          if (Util.isNotBlank(queryExpanded)) {
            query.append(queryExpanded);
            if (queryTemplates.hasNext()) {
              query.append("&");
            }
          }
        }
  
        String queryString = query.toString();
        if (!queryString.isEmpty()) {
          Matcher queryMatcher = QUERY_STRING_PATTERN.matcher(uri);
          if (queryMatcher.find()) {
            /* the uri already has a query, so any additional queries should be appended */
            uri.append("&");
          } else {
            uri.append("?");
          }
          uri.append(queryString);
        }
      }
  
      /* add the uri to result */
      resolved.uri(uri.toString());
  
      /* headers */
      if (!this.headers.isEmpty()) {
        /*
         * same as the query string, we only want to keep resolved values, so clear the header map on
         * the resolved instance
         */
        resolved.headers(Collections.emptyMap());
        for (HeaderTemplate headerTemplate : this.headers.values()) {
          /* resolve the header */
          String header = headerTemplate.expand(variables);
          if (!header.isEmpty()) {
            /* split off the header values and add it to the resolved template */
            String headerValues = header.substring(header.indexOf(" ") + 1);
            if (!headerValues.isEmpty()) {
              resolved.header(headerTemplate.getName(), headerValues);
            }
          }
        }
      }
  
      resolved.body(this.body.expand(variables));
  
      /* mark the new template resolved */
      resolved.resolved = true;
      return resolved;
    }