class UrlHelper {

    public static String createParameterString(List<Pair<String, String>> parameters) {
        Validate.notNull(parameters, "parameters must not be null");
        StringBuilder builder = new StringBuilder();
        boolean first = true;
        for (Pair<String, String> pair : parameters) {
            if (first) {
                first = false;
            } else {
                builder.append('&');
            }
            builder.append(encodeParameter(pair.getKey()));
            builder.append('=');
            String value = pair.getValue();
            builder.append(encodeParameter(value != null ? value : StringUtils.EMPTY));
        }
        return builder.toString();
    }

    private  UrlHelper();

}