HttpServletDummyRequest req = new HttpServletDummyRequest();
HttpServletDummyRequest req = new HttpServletDummyRequest("localhost","", "/foo", "/bar", null);
    public void testEncodeURL() {        HttpServletDummyRequest req = new HttpServletDummyRequest();        HttpServletDummyResponse resp = new HttpServletDummyResponse();        req.setURL("/foo/bar");        req.setParameterValues("x", "xvalue");        req.setParameterValues("y", "32");        String encoded = URLRewriter.encodeURL(req, resp,                                               "/baz/quux?y=32&z=z%20value");        assertTrue(encoded.startsWith("/baz/quux?"));        assertTrue(encoded.indexOf("param2=param2value") > 0);        assertTrue(encoded.indexOf("param1=param1value") > 0);        assertTrue(encoded.indexOf("y=32") > 0);        assertTrue(encoded.indexOf("z=z+value") > 0 ||               encoded.indexOf("z=z%20value") > 0);        encoded = URLRewriter.encodeRedirectURL(req, resp,                                                "/baz/quux?y=32&z=z%20value");        assertTrue(encoded.startsWith("/baz/quux?"));        assertTrue(encoded.indexOf("param2=param2value") > 0);        assertTrue(encoded.indexOf("param1=param1value") > 0);        assertTrue(encoded.indexOf("y=32") > 0);        assertTrue(encoded.indexOf("z=z+value") > 0 ||               encoded.indexOf("z=z%20value") > 0);    }