### Question:
QueryStringDecoder { public String uri() { return uri; } 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 testURI() { URI uri = URI.create("http: QueryStringDecoder decoder = new QueryStringDecoder(uri); Assert.assertEquals("/foo", decoder.path()); Map<String, List<String>> params = decoder.parameters(); Assert.assertEquals(3, params.size()); Iterator<Entry<String, List<String>>> entries = params.entrySet().iterator(); Entry<String, List<String>> entry = entries.next(); Assert.assertEquals("param1", entry.getKey()); Assert.assertEquals(1, entry.getValue().size()); Assert.assertEquals("value1", entry.getValue().get(0)); entry = entries.next(); Assert.assertEquals("param2", entry.getKey()); Assert.assertEquals(1, entry.getValue().size()); Assert.assertEquals("value2", entry.getValue().get(0)); entry = entries.next(); Assert.assertEquals("param3", entry.getKey()); Assert.assertEquals(1, entry.getValue().size()); Assert.assertEquals("value3", entry.getValue().get(0)); Assert.assertFalse(entries.hasNext()); }