UrlDecoder { public static String decode(String url) { try { return java.net.URLDecoder.decode(url, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } } private  UrlDecoder(); static String decode(String url); static String decode(String url, boolean plus);  }
@Test public void t1() { assertEquals("a/b", UrlDecoder.decode("a%2Fb")); assertEquals("1-2", UrlDecoder.decode("1-2")); assertEquals("1 2", UrlDecoder.decode("1+2")); assertEquals("1 2", UrlDecoder.decode("1+2", true)); assertEquals("1+2", UrlDecoder.decode("1+2", false)); assertEquals("1+2", UrlDecoder.decode("1+2", false)); assertEquals("1 2 3", UrlDecoder.decode("1+2+3", true)); }