@Test
public void testEntireUnicodeRange() throws UnsupportedEncodingException {

  for (int i = MIN_CODE_POINT; i < MAX_CODE_POINT; i++) {
    if (isSurrogate((char) i)) {
      continue;
    }
    final String s = String.valueOf(Character.toChars(i));
    final String encoded = urlPathSegmentEscaper().escape(s);
    final CharSequence decoded = Encoding.decode(encoded);
    assertThat(decoded.toString(), is(s));
  }
}