protected function add($parentName = null, $nodeName, ChildNodeInterface $node, $prepend = false)
    {
        if (!self::addTreeNode($this->hierarchy, $parentName, $nodeName, $prepend)) {
            throw new NodeNotFoundException(
                "Can't add '$nodeName' node to '$parentName': '$parentName' node not found."
            );
        }
        $this->removeNodeFromList($nodeName);
        $this->nodes->set($nodeName, $node);
        $this->updateRequired = true;

        return $this;
    }