### Question:
QueryStringDecoder { public String path() { if (path == null) { path = decodeComponent(uri, 0, pathEndIdx(), charset, true); } return path; } QueryStringDecoder(String uri);  QueryStringDecoder(String uri, boolean hasPath);  QueryStringDecoder(String uri, Charset charset);  QueryStringDecoder(String uri, Charset charset, boolean hasPath);  QueryStringDecoder(String uri, Charset charset, boolean hasPath, int maxParams);  QueryStringDecoder(URI uri);  QueryStringDecoder(URI uri, Charset charset);  QueryStringDecoder(URI uri, Charset charset, int maxParams); @Override String toString(); String uri(); String path(); Map<String, List<String>> parameters(); static String decodeComponent(final String s); static String decodeComponent(final String s, final Charset charset);  }### Answer:
@Test public void testPathSpecific() { Assert.assertEquals("/foo bar/", new QueryStringDecoder("/foo%20bar/?").path()); Assert.assertEquals("/foo\r\n\\bar/", new QueryStringDecoder("/foo%0D%0A\\bar/?").path()); Assert.assertEquals("", new QueryStringDecoder("#123").path()); Assert.assertEquals("foo", new QueryStringDecoder("foo?bar#anchor").path()); Assert.assertEquals("/foo-bar", new QueryStringDecoder("/foo-bar#anchor").path()); Assert.assertEquals("/foo-bar", new QueryStringDecoder("/foo-bar#a#b?c=d").path()); Assert.assertEquals("+", new QueryStringDecoder("+").path()); Assert.assertEquals("/foo+bar/", new QueryStringDecoder("/foo+bar/?").path()); Assert.assertEquals("/foo++", new QueryStringDecoder("/foo++?index.php").path()); Assert.assertEquals("/foo +", new QueryStringDecoder("/foo%20+?index.php").path()); Assert.assertEquals("/foo+ ", new QueryStringDecoder("/foo+%20").path()); }