code: public URL applyOnURL(URL url) {
          if (url == null) {
              return url;
          }
          try {
              return new URL(applyOnURL(url.toString()));
          } catch (MalformedURLException e) {
              throw new RuntimeException("Cannot applyl query string to: " + url, e);
          }
      }
docs: Apply this url QueryString on the given URL. If a query string already
  exists, it is replaced by this one.
  @param url the URL to apply this query string.
  @return url with query string added