@Test
public void testURI() {

    URI uri = URI.create("http://localhost:8080/foo?param1=value1&param2=value2&param3=value3");
    QueryStringDecoder decoder = new QueryStringDecoder(uri);
    Assert.assertEquals("/foo", decoder.path());
    Assert.assertEquals("/foo", decoder.rawPath());
    Assert.assertEquals("param1=value1&param2=value2&param3=value3", decoder.rawQuery());
    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());
}