@Test
public void testURI() {

    URI uri = URI.create("http://localhost:8080/foo?param1=value1&param2=value2&param3=value3");
    QueryStringDecoderUtil decoder = new QueryStringDecoderUtil(uri);
    assertEquals("/foo", decoder.path());
    Map<String, List<String>> params = decoder.parameters();
    assertEquals(3, params.size());
    Iterator<Entry<String, List<String>>> entries = params.entrySet().iterator();
    Entry<String, List<String>> entry = entries.next();
    assertEquals("param1", entry.getKey());
    assertEquals(1, entry.getValue().size());
    assertEquals("value1", entry.getValue().get(0));
    entry = entries.next();
    assertEquals("param2", entry.getKey());
    assertEquals(1, entry.getValue().size());
    assertEquals("value2", entry.getValue().get(0));
    entry = entries.next();
    assertEquals("param3", entry.getKey());
    assertEquals(1, entry.getValue().size());
    assertEquals("value3", entry.getValue().get(0));
    assertFalse(entries.hasNext());
}