public function tryGetClassMetadataById(string $id): ?ClassMetadata
    {
        $key = $this->parseKeyFromId($id);

        foreach ($this->classMetadataList as $classMetadata) {
            if ($key === $classMetadata->getKey()) {
                return $classMetadata;
            }
        }

        return null;
    }