code: @Override
  	public void add(final TreeNode node) {
  		if (node == this) {
  			throw new IllegalArgumentException("Can't add a node to itself");
  		}
  
  		if (this.isAncestor(node)) {
  			throw new IllegalArgumentException("Can't add an ancestor as a child node");
  		}
  
  		if (node.getParent() != null) {
  			node.getParent().remove(node);
  		}
  
  		if (children == null) {
  			children = new ArrayList<>();
  		}
  
  		children.add(node);
  
  		if (node instanceof AbstractTreeNode) {
  			((AbstractTreeNode) node).parent = this;
  		}
  	}
docs: {@inheritDoc}