### Question:
UrlUtils { public static String urlDecode(String value, String enc) { return urlDecode(value, enc, false); } private  UrlUtils(); static String urlEncode(String value); static String urlEncode(String value, String enc); static String urlDecode(String value, String enc); static String urlDecode(String value); static String pathDecode(String value); static Map<String, String> parseQueryString(String s); static String getStem(String baseURI);  }### Answer:
@Test public void testUrlDecode() { assertEquals("+ ", UrlUtils.urlDecode("%2B+")); }
@Test public void testUrlDecodeReserved() { assertEquals("!$&'()*,;=", UrlUtils.urlDecode("!$&'()*,;=")); }
@Test public void testUrlDecodeIncompleteEscapePatterns() { try { UrlUtils.urlDecode("%"); fail(); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().startsWith("Invalid URL encoding")); } try { UrlUtils.urlDecode("a%%%%"); fail(); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().startsWith("Invalid URL encoding")); } try { UrlUtils.urlDecode("a%2B%"); fail(); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().startsWith("Invalid URL encoding")); } try { UrlUtils.urlDecode("%2"); fail(); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().startsWith("Invalid URL encoding")); } }
@Test public void testUrlDecodeInvalidEscapePattern() { try { UrlUtils.urlDecode("%2$"); fail(); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().startsWith("Invalid URL encoding")); } }