@Test
public void encodePathSegment() {

    assertEquals("foo", UriEncoding.encodePathSegment("foo"));
    assertEquals("%2Ftop%2Fsub", UriEncoding.encodePathSegment("/top/sub"));
    assertEquals("!%22%23$%25&'()*+,%2F:;=%3F@%5B%5C%5D%7B%7C%7D%20%C3%A4aZ0",
            UriEncoding.encodePathSegment(MANY_DIFFERENT_CHARS));
}