@Test
public void testParse() {

    Address addr = Address.parse("/parent=foo");
    assert addr.getAddressNode().asList().size() == 1;
    assert addr.getAddressNode().asList().get(0).get("parent").asString().equals("foo");
    addr = Address.parse("/parent=foo/child=bar");
    assert addr.getAddressNode().asList().size() == 2;
    assert addr.getAddressNode().asList().get(0).get("parent").asString().equals("foo");
    assert addr.getAddressNode().asList().get(1).get("child").asString().equals("bar");
    addr = Address.parse("/parent=foo/child=bar/"); // trailing / shouldn't matter
    assert addr.getAddressNode().asList().size() == 2;
    assert addr.getAddressNode().asList().get(0).get("parent").asString().equals("foo");
    assert addr.getAddressNode().asList().get(1).get("child").asString().equals("bar");
    addr = Address.parse("parent=foo/child=bar"); // missing leading / shouldn't matter
    assert addr.getAddressNode().asList().size() == 2;
    assert addr.getAddressNode().asList().get(0).get("parent").asString().equals("foo");
    assert addr.getAddressNode().asList().get(1).get("child").asString().equals("bar");
    addr = Address.parse("/a-b-c=x-y-z/a_b_c=x_y_z"); // special chars in names
    assert addr.getAddressNode().asList().size() == 2;
    assert addr.getAddressNode().asList().get(0).get("a-b-c").asString().equals("x-y-z");
    assert addr.getAddressNode().asList().get(1).get("a_b_c").asString().equals("x_y_z");
    addr = Address.parse("/parent"); // partial address
    assert addr.getAddressNode().asList().size() == 1;
    assert addr.getAddressNode().asList().get(0).get("parent").asString().equals("");
    addr = Address.parse("/parent="); // partial address
    assert addr.getAddressNode().asList().size() == 1;
    assert addr.getAddressNode().asList().get(0).get("parent").asString().equals("");
    addr = Address.parse("/parent=/child="); // partial addresses (is this even valid DMR?)
    assert addr.getAddressNode().asList().size() == 2;
    assert addr.getAddressNode().asList().get(0).get("parent").asString().equals("");
    assert addr.getAddressNode().asList().get(1).get("child").asString().equals("");
}