public function checkNodeTypeMappings(DocumentManagerInterface $documentManager)
    {
        $knownNodeTypes = [];
        $debugInformation = [];
        $allMetadata = $documentManager->getMetadataFactory()->getAllMetadata();

        foreach ($allMetadata as $classMetadata) {
            if ($classMetadata->hasUniqueNodeType() && isset($knownNodeTypes[$classMetadata->getNodeType()])) {
                throw new MappingException(sprintf(
                    'The class "%s" is mapped with uniqueNodeType set to true, but the node type "%s" is used by "%s" as well.',
                    $classMetadata->name,
                    $classMetadata->getNodeType(),
                    $knownNodeTypes[$classMetadata->getNodeType()]
                ));
            }

            $knownNodeTypes[$classMetadata->getNodeType()] = $classMetadata->name;

            $debugInformation[$classMetadata->name] = [
                'unique_node_type' => $classMetadata->hasUniqueNodeType(),
                'node_type'        => $classMetadata->getNodeType(),
            ];
        }

        return $debugInformation;
    }