RelativeUriBuilder { @Override public String toString() { String s = delegate.toString().substring(STARTING_URI_LENGTH); while (s.startsWith("/")) { s = s.substring(1); } return s; } private  RelativeUriBuilder(); private  RelativeUriBuilder(URI previous); static RelativeUriBuilder relativeUriBuilder(); static RelativeUriBuilder relativeUriBuilder(String path); static RelativeUriBuilder relativeUriBuilderFrom(URI uri); RelativeUriBuilder replacePath(String path); RelativeUriBuilder appendPath(String path); RelativeUriBuilder replaceParameter(String name, String... values); RelativeUriBuilder replaceParameter(String name, Iterable<String> values); RelativeUriBuilder addParameter(String name, String... values); RelativeUriBuilder addParameter(String name, Iterable<String> values); RelativeUriBuilder replaceRawQuery(String rawQuery); @Override String toString(); URI build();  }
@Test public void testToString() { URI original = URI.create("http: assertEquals(relativeUriBuilderFrom(original).toString(), "a%20/%C3%A5?k=1&k=2&%C3%A5=3"); assertEquals(relativeUriBuilder().toString(), ""); }