EncodeUtil { public static String urlDecode(String toDecode) { try { return URLDecoder.decode(toDecode, ENCODING); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } private  EncodeUtil(); static String urlEncode(String toEncode); static String urlDecode(String toDecode); static final String ENCODING; }
@Test public void testUrlDecode() throws Exception { for (int i = 0; i < chars.length; i++) { assertEquals("Test decoding '" + chars[i] + "'", chars[i], EncodeUtil.urlDecode(encoded[i])); } }