@Test
public void testParseSegments() throws Exception {

    MatcherAssert.assertThat(parsePath("/this/that"), CoreMatchers.equalTo(Arrays.asList("this", "that")));
    MatcherAssert.assertThat(parsePath("this/that"), CoreMatchers.equalTo(Arrays.asList("this", "that")));
    MatcherAssert.assertThat(parsePath("this//that"), CoreMatchers.equalTo(Arrays.asList("this", "", "that")));
    MatcherAssert.assertThat(parsePath("this//that/"), CoreMatchers.equalTo(Arrays.asList("this", "", "that", "")));
    MatcherAssert.assertThat(parsePath("this//that/%2fthis%20and%20that"),
            CoreMatchers.equalTo(Arrays.asList("this", "", "that", "/this and that")));
    MatcherAssert.assertThat(parsePath("this///that//"),
            CoreMatchers.equalTo(Arrays.asList("this", "", "", "that", "", "")));
    MatcherAssert.assertThat(parsePath("/"), CoreMatchers.equalTo(Collections.singletonList("")));
    MatcherAssert.assertThat(parsePath(""), CoreMatchers.equalTo(Collections.<String>emptyList()));
}