private static function hasDuplicates(array $entityPath): bool
    {
        $found = [];
        foreach ($entityPath as $field) {
            $key = $field['field'] . "\0" . $field['class'];
            if (array_key_exists($key, $found)) {
                return true;
            }
            $found[$key] = true;
        }
        return false;
    }