### Question:
Encoder { public static String query(CharSequence s) throws IllegalArgumentException { try { return URLEncoder.encode(s.toString(), UTF8.name()); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } }  static String path(CharSequence s); static String query(CharSequence s);  }### Answer:
@Test public void testQuery() { assertEquals("test", Encoder.query("test")); assertEquals("hello+world", Encoder.query("hello world")); assertEquals("a%7Cb", Encoder.query("a|b")); assertEquals("%5Btest%5D", Encoder.query("[test]")); assertEquals("%22a%22", Encoder.query("\"a\"")); assertEquals("Really%3F", Encoder.query("Really?")); }