Address implements Cloneable { public String toAddressPathString() { if (isRoot()) { return "/"; } StringBuilder str = new StringBuilder(); List<Property> parts = addressNode.asPropertyList(); for (Property part : parts) { String name = part.getName(); String value = part.getValue().asString(); str.append("/").append(name).append("=").append(value); } return str.toString(); } Address();  Address(String... addressParts); static Address root(); static Address parse(String addressStr); static Address fromModelNode(ModelNode node); static Address fromModelNodeWrapper(ModelNode haystack, String needle); ModelNode getAddressNode(); Address add(String... addressParts); Address add(String type, String name); Address add(Address address); boolean isRoot(); String[] toAddressParts(); String toAddressPathString(); @Override Address clone(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testToAddressPathString() { Address addr = Address.root(); assert addr.toAddressPathString().equals("/") : addr.toAddressPathString(); addr = Address.root().add("one", "two"); assert addr.toAddressPathString().equals("/one=two") : addr.toAddressPathString(); addr = Address.root().add("one", "two", "three", "four"); assert addr.toAddressPathString().equals("/one=two/three=four") : addr.toAddressPathString(); addr = Address.root().add("one", "two", "three", "four", "5", "6"); assert addr.toAddressPathString().equals("/one=two/three=four/5=6") : addr.toAddressPathString(); }