code: private String build() throws URISyntaxException {
  
          URI uri = new URI(protocol, userInfo, host, port, path, null, null);
          StringBuilder url = new StringBuilder(uri.toString());
          if (query != null && query.size() > 0) {
              url.append("?");
              url.append(query.toQueryString());
          }
          if (StringUtils.isNotBlank(fragment)) {
              url.append("#");
              url.append(fragment);
          }
  
          return url.toString();
      }
docs: Builds a String representation of this URL. This method works around
  double-escaping when passing the result of
  {@link QueryString#toQueryString()} to the {@link URI} constructor.
  
  @return A string representation of this URL.
  @throws URISyntaxException If an error occurs in parsing the URL.