### Question:
QueryStringDecoder { public Map<String, List<String>> parameters() { if (params == null) { params = decodeParams(uri, pathEndIdx(), charset, maxParams); } return params; } 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 testBasicUris() throws URISyntaxException { QueryStringDecoder d = new QueryStringDecoder(new URI("http: Assert.assertEquals(0, d.parameters().size()); }
@Test public void testExcludeFragment() { Assert.assertEquals("a", new QueryStringDecoder("?a#anchor").parameters().keySet().iterator().next()); Assert.assertEquals("b", new QueryStringDecoder("?a=b#anchor").parameters().get("a").get(0)); Assert.assertTrue(new QueryStringDecoder("?#").parameters().isEmpty()); Assert.assertTrue(new QueryStringDecoder("?#anchor").parameters().isEmpty()); Assert.assertTrue(new QueryStringDecoder("#?a=b#anchor").parameters().isEmpty()); Assert.assertTrue(new QueryStringDecoder("?#a=b#anchor").parameters().isEmpty()); }