### Question:
PercentDecoder { public static String decodeAll(String str) { return decode(str, CodepointMatcher.ALL); } private  PercentDecoder(); static String decodeAll(String str); static String decodeUnreserved(String str);  }### Answer:
@Test public void allAscii() { StringBuilder expected = new StringBuilder(); StringBuilder encoded = new StringBuilder(); for (char c = 0; c < 0x80; c++) { expected.append(c); encoded.append(percentEncode(c)); } assertEquals(expected.toString(), PercentDecoder.decodeAll(encoded.toString())); }
@Test public void decodingSafelyHandlesMalformedPercents() { assertSame("%zz", PercentDecoder.decodeAll("%zz")); assertSame("%3", PercentDecoder.decodeAll("%3")); assertSame("%3z", PercentDecoder.decodeAll("%3z")); assertSame("%", PercentDecoder.decodeAll("%")); assertSame("%%2", PercentDecoder.decodeAll("%%2")); assertSame("%2%", PercentDecoder.decodeAll("%2%")); }