### Question:
Decoder { public static String path(final CharSequence path) { return decode(path, false); }  static String path(final CharSequence path); static String query(final CharSequence query); static String decode(final CharSequence path, final boolean query);  }### Answer:
@Test public void pathNotEncoded() { assertEquals("/foobar", Decoder.path("/foobar")); }
@Test public void pathSpaceDecoding() { assertEquals("/foo bar", Decoder.path("/foo%20bar")); assertEquals("/foo bar", Decoder.path("/foo bar")); }
@Test public void pathQuotationMark() { assertEquals("/foo\"bar", Decoder.path("/foo%22bar")); assertEquals("/foo\"bar", Decoder.path("/foo\"bar")); }
@Test public void pathQuestionMark() { assertEquals("/foo?bar", Decoder.path("/foo%3Fbar")); assertEquals("/foo?bar", Decoder.path("/foo%3fbar")); assertEquals("/foo?bar", Decoder.path("/foo?bar")); }
@Test public void pathLetterAWithDiaeresis() { assertEquals("/foo\u00E4bar", Decoder.path("/foo%C3%A4bar")); assertEquals("/foo\u00E4bar", Decoder.path("/foo\u00E4bar")); }
@Test public void pathMultipleLettersAWithDiaeresis() { assertEquals("/foo\u00E4\u00E4\u00E4bar", Decoder.path("/foo%C3%A4%C3%A4%C3%A4bar")); }
@Test public void pathArmenianCapitalLetterCheh() { assertEquals("/foo\u0543bar", Decoder.path("/foo%D5%83bar")); assertEquals("/foo\u0543bar", Decoder.path("/foo\u0543bar")); }
@Test public void pathInvalidByteSequenceConvertedToReplacementChars() { assertEquals("/foo\uFFFD\uFFFDbar", Decoder.path("/foo%83%83bar")); }
@Test public void pathSingleContinuationCharConvertedToReplacementChars() { assertEquals("/foo\uFFFD", Decoder.path("/foo%83")); }
@Test public void pathTrailingPercentSign() { assertEquals("/foo", Decoder.path("/foo%")); }
@Test public void pathTrailingIncompleteEscapeSequence() { assertEquals("/foo", Decoder.path("/foo%3")); }
@Test public void pathNonHexValueAfterPercent() { assertEquals("/f\uFFFDbar", Decoder.path("/f%oobar")); }
@Test public void pathNonHexValueInContinuationByte() { assertEquals("/foo\uFFFDbar", Decoder.path("/foo%C3%xxbar")); }