public function isDescendant(int $id): bool
    {
        if ($this->isChild($id)) {
            return true;
        }

        foreach ($this->children as $childId => $child) {
            /** @var InnerNode $node */
            $node = $child['node'];
            if ($node instanceof InnerNode &&
                $node->hasChildren() &&
                $node->isDescendant($id)
            ) {
                return true;
            }
        }

        return false;
    }