UriBuilder builder1 = new UriBuilderImpl();
builder1.scheme("http").host("localhost").port(80);
builder1.segment("path1", "path2");
builder1.matrixParam("mat1", "{var1}", "v2");
builder1.queryParam("q1", "abc");
builder1.fragment("fragment");
UriBuilder builder2 = builder1.clone();
String uri1 = builder1.build("v1").toString();
String uri2 = builder2.build("v1").toString();
assertEquals(uri1, uri2);
assertNotSame(builder1, builder2);