public function validateByOnlyOne($nodeType, TreeInterface $tree)
    {
        if (!$nodeType) {
            return true;
        }

        $config = $this->getNodeTypeConfig($nodeType);
        if (null === $config) {
            return false;
        }

        if ($config->isOnlyOne()) {
            return !in_array($nodeType, $this->nodeManager->findExistingNodeTypes($tree));
        }

        return true;
    }