public function addChild(NodeInterface $child, bool $setParent = true): NodeInterface
    {
        if (!$this->supportsChild($child)) {
            throw ChildTypeNotSupportedException::create($this, $child);
        }

        $this->_children[$child->getId()] = $child;

        if ($setParent) {
            $child->addParent($this, false);
        }

        /** @var NodeInterface $parent */
        foreach ($this->getAllParentsAndCurrentNode() as $parent) {
            $child->addSubscriber($parent);
        }

        $this->notifySubscribers(
            self::EVENT_ADD_CHILD,
            ['parent' => $this, 'child' => $child]
        );

        return $this;
    }