code: public URIBuilder setParameter(final String param, final String value) {
          if (this.queryParams == null) {
              this.queryParams = new ArrayList<NameValuePair>();
          }
          if (!this.queryParams.isEmpty()) {
              for (Iterator<NameValuePair> it = this.queryParams.iterator(); it.hasNext(); ) {
                  NameValuePair nvp = it.next();
                  if (nvp.getName().equals(param)) {
                      it.remove();
                  }
              }
          }
          this.queryParams.add(new BasicNameValuePair(param, value));
          this.encodedQuery = null;
          this.encodedSchemeSpecificPart = null;
          return this;
      }
docs: Sets parameter of URI query overriding existing value if set. The parameter name and value
  are expected to be unescaped and may contain non ASCII characters.