Location implements Serializable { public List<String> getSegments() { return Collections.unmodifiableList(segments); } Location(String location);  Location(String location, QueryParameters queryParameters);  Location(List<String> segments);  Location(List<String> segments, QueryParameters queryParameters); List<String> getSegments(); QueryParameters getQueryParameters(); String getFirstSegment(); Optional<Location> getSubLocation(); String getPath(); String getPathWithQueryParameters(); Location toggleTrailingSlash();  }
@Test public void parseLocationWithEndingSlash() { Location location = new Location("foo/bar/"); assertEquals(Arrays.asList("foo", "bar", ""), location.getSegments()); }
@Test public void umlautInLocation() { Location location = new Location("foo/åäö/bar"); assertEquals("foo", location.getSegments().get(0)); assertEquals("åäö", location.getSegments().get(1)); assertEquals("bar", location.getSegments().get(2)); }