private void addOrUpdateArg(String key, Object value) throws UnsupportedEncodingException {
    key = URLDecoder.decode(key, "UTF-8");
    if (value != null && value instanceof String) {
      String valueStr = URLDecoder.decode((String) value, "UTF-8");
      StringBuilder sb;
      if (args.get(key) == null) {
        sb = new StringBuilder(valueStr);
        args.put(key, sb);
      } else {
        sb = (StringBuilder) args.get(key);
        sb.append(MULTIPLE_HEADER_VALUE_DELIMITER).append(value);
      }
    } else if (value != null && args.containsKey(key)) {
      throw new IllegalStateException("Value of key [" + key + "] is not a string and it already exists in the args");
    } else {
      args.put(key, value);
    }
  }
Adds a {@code key}, {@code value} pair to args after URL decoding them. If {@code key} already exists,
{@code value} is added to a list of values.
@param key the key of the argument.
@param value the value of the argument.
@throws UnsupportedEncodingException if {@code key} or {@code value} cannot be URL decoded.
ambry-test-utils/src/main/java/com/github/ambry/rest/MockRestRequest.java