@Test
public void parsesPathSegments() {

    String path = "/to/be/or%20not/to/be;a=foo;b=b%20a%23r";
    List<PathSegment> expected = newArrayList(PathSegmentImpl.fromString("to", false),
                                              PathSegmentImpl.fromString("be", false),
                                              PathSegmentImpl.fromString("or not", false),
                                              PathSegmentImpl.fromString("to", false),
                                              PathSegmentImpl.fromString("be;a=foo;b=b a#r", false)
                                             );
    List<PathSegment> result = parsePathSegments(path, true);
    assertEquals(expected, result);
}