@Override
    public synchronized String toString() {
        if (parameters.isEmpty()) {
            return "";
        }
        StringBuilder b = new StringBuilder();
        char sep = '?';
        for (String key : parameters.keySet()) {
            for (String value : parameters.get(key)) {
                b.append(sep);
                sep = '&';
                try {
                    b.append(URLEncoder.encode(key, encoding));
                    b.append('=');
                    b.append(URLEncoder.encode(value, encoding));
                } catch (UnsupportedEncodingException e) {
                    throw new RuntimeException(
                            "Cannot URL-encode query string (key="
                                    + key + "; value=" + value + ").", e);
                }
            }
        }
        return b.toString();
    }
@Test
    public void testKeepProtocolUpperCase() {
        QueryString qs = new QueryString(
                "http://site.com/page?NoEquals&WithEquals=EqualsValue");

        Assert.assertTrue("Argument without equal sign was not found.",
                qs.toString().contains("NoEquals"));
    }