class UrlHelper {

    public static List<Pair<String, String>> parseParams(String parameterString) {
        Validate.notNull(parameterString, "parameterString must not be null");
        List<Pair<String, String>> params = new ArrayList<>();

        int questionIdx = parameterString.indexOf("?");
        if (questionIdx == -1) { // no parameters in URL
            return params;
        }

        String paramSubString = parameterString.substring(questionIdx + 1);
        String[] paramSplit = paramSubString.split("&");
        for (String param : paramSplit) {
            String[] keyValue = param.split("=");
            String key = tryDecodeParameter(keyValue[0]);
            String value;
            if (keyValue.length == 1) {
                value = StringUtils.EMPTY;
            } else {
                value = tryDecodeParameter(param.substring(key.length() + 1));
            }
            params.add(Pair.of(key, value));
        }
        return params;
    }

    private  UrlHelper();

}