code: private static List<String> splitAndEncodeParams(URL url) {
  		if (url.getQuery() == null) {
  			return new ArrayList<>();
  		}
  		String[] params = url.getQuery().split("&");
  		List<String> result = new ArrayList<>(params.length);
  		for (String p : params) {
  			String[] kv = p.split("=");
  			kv[0] = PercentEncoding.decode(kv[0]);
  			kv[1] = PercentEncoding.decode(kv[1]);
  			kv[0] = PercentEncoding.encode(kv[0]);
  			kv[1] = PercentEncoding.encode(kv[1]);
  			String np = kv[0] + "=" + kv[1];
  			result.add(np);
  		}
  		return result;
  	}
docs: Splits the query parameters of the given URL, encodes their
  keys and values and puts each key-value pair in a list
  @param url the URL
  @return the encoded parameters