Location implements Serializable { public String getPathWithQueryParameters() { String basePath = getPath(); assert !basePath.contains( QUERY_SEPARATOR) : "Base path can not contain query separator=" + QUERY_SEPARATOR; String params = queryParameters.getQueryString(); if (params.isEmpty()) { return basePath; } else { return basePath + QUERY_SEPARATOR + params; } } 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 pathShouldBeEmpty() { assertEquals("", new Location("").getPathWithQueryParameters()); }