public void testDefensiveCopyOfChildren() {
Node<Object, Object> rootNode = cache.getRoot();
Fqn childFqn = Fqn.fromString("/child");
rootNode.addChild(childFqn).put("k", "v");
Set<Node<Object, Object>> children = rootNode.getChildren();
Set<Object> childrenNames = rootNode.getChildrenNames();
assert childrenNames.size() == 1;
assert childrenNames.contains(childFqn.getLastElement());
assert children.size() == 1;
assert children.iterator().next().getFqn().equals(childFqn);
// now change stuff.
rootNode.addChild(Fqn.fromString("/child2"));
// assert that the collections we initially got have not changed.
assert childrenNames.size() == 1;
assert childrenNames.contains(childFqn.getLastElement());
assert children.size() == 1;
assert children.iterator().next().getFqn().equals(childFqn);
}