It would be nice if ContainerNode.getNode(int) could accept only valid indices. The current implementation hides some potential bugs.
public Node getNode(int index) {
if (index >= 0 && index < nodes.size()) {
return nodes.get(index);
}
return null;
}