protected function createNodeInstance(array $data, array $options = []): NodeInterface
    {
        $factory = $this->getNodeFactory();

        $node = $factory($data, $options);

        if (!is_object($node) || !($node instanceof NodeInterface)) {
            throw ValidationException::create(
                'Node Factory must return an instance of NodeInterface.'
            );
        }

        $this->_nodeRegistry[$node->getId()] = $node;

        return $node;
    }