@Test
void testUrlEncoded() {

    UrlEncoded url_encoded = new UrlEncoded();
    assertEquals(0, url_encoded.size());
    url_encoded.clear();
    url_encoded.decode("");
    assertEquals(0, url_encoded.size());
    url_encoded.clear();
    url_encoded.decode("Name1=Value1");
    assertEquals(1, url_encoded.size());
    assertEquals("Name1=Value1", url_encoded.encode());
    assertEquals("Value1", url_encoded.getString("Name1"));
    url_encoded.clear();
    url_encoded.decode("Name2=");
    assertEquals(1, url_encoded.size());
    assertEquals("Name2", url_encoded.encode());
    assertEquals("", url_encoded.getString("Name2"));
    url_encoded.clear();
    url_encoded.decode("Name3");
    assertEquals(1, url_encoded.size());
    assertEquals("Name3", url_encoded.encode());
    assertEquals("", url_encoded.getString("Name3"));
    url_encoded.clear();
    url_encoded.decode("Name4=V\u0629lue+4%21");
    assertEquals(1, url_encoded.size());
    assertEquals("Name4=V%D8%A9lue+4%21", url_encoded.encode());
    assertEquals("V\u0629lue 4!", url_encoded.getString("Name4"));
    url_encoded.clear();
    url_encoded.decode("Name4=Value%2B4%21");
    assertEquals(1, url_encoded.size());
    assertEquals("Name4=Value%2B4%21", url_encoded.encode());
    assertEquals("Value+4!", url_encoded.getString("Name4"));
    url_encoded.clear();
    url_encoded.decode("Name4=Value+4%21%20%214");
    assertEquals(1, url_encoded.size());
    assertEquals("Name4=Value+4%21+%214", url_encoded.encode());
    assertEquals("Value 4! !4", url_encoded.getString("Name4"));
    url_encoded.clear();
    url_encoded.decode("Name5=aaa&Name6=bbb");
    assertEquals(2, url_encoded.size());
    assertTrue(url_encoded.encode().equals("Name5=aaa&Name6=bbb") ||
            url_encoded.encode().equals("Name6=bbb&Name5=aaa")
    );
    assertEquals("aaa", url_encoded.getString("Name5"));
    assertEquals("bbb", url_encoded.getString("Name6"));
    url_encoded.clear();
    url_encoded.decode("Name7=aaa&Name7=b%2Cb&Name7=ccc");
    assertEquals("Name7=aaa&Name7=b%2Cb&Name7=ccc", url_encoded.encode());
    assertEquals("aaa,b,b,ccc", url_encoded.getString("Name7"));
    assertEquals("aaa", url_encoded.getValues("Name7").get(0));
    assertEquals("b,b", url_encoded.getValues("Name7").get(1));
    assertEquals("ccc", url_encoded.getValues("Name7").get(2));
    url_encoded.clear();
    url_encoded.decode("Name8=xx%2C++yy++%2Czz");
    assertEquals(1, url_encoded.size());
    assertEquals("Name8=xx%2C++yy++%2Czz", url_encoded.encode());
    assertEquals("xx,  yy  ,zz", url_encoded.getString("Name8"));
}