docs: public static CacheKeyGenerator getCacheKeyGenerator(BeanManager beanManager, Class<? extends CacheKeyGenerator> methodCacheKeyGeneratorClass, CacheDefaults cacheDefaultsAnnotation) {
        assertNotNull(beanManager, "beanManager parameter must not be null");
  
        Class<? extends CacheKeyGenerator> cacheKeyGeneratorClass = DefaultCacheKeyGenerator.class;
        if (!CacheKeyGenerator.class.equals(methodCacheKeyGeneratorClass)) {
           cacheKeyGeneratorClass = methodCacheKeyGeneratorClass;
        } else if (cacheDefaultsAnnotation != null && !CacheKeyGenerator.class.equals(cacheDefaultsAnnotation.cacheKeyGenerator())) {
           cacheKeyGeneratorClass = cacheDefaultsAnnotation.cacheKeyGenerator();
        }
  
        final CreationalContext<?> creationalContext = beanManager.createCreationalContext(null);
        final Set<Bean<?>> beans = beanManager.getBeans(cacheKeyGeneratorClass);
        if (!beans.isEmpty()) {
           final Bean<?> bean = beanManager.resolve(beans);
           return (CacheKeyGenerator) beanManager.getReference(bean, CacheKeyGenerator.class, creationalContext);
        }
  
        // the CacheKeyGenerator implementation is not managed by CDI
        try {
  
           return cacheKeyGeneratorClass.newInstance();
  
        } catch (InstantiationException e) {
           throw log.unableToInstantiateCacheKeyGenerator(cacheKeyGeneratorClass, e);
        } catch (IllegalAccessException e) {
           throw log.unableToInstantiateCacheKeyGenerator(cacheKeyGeneratorClass, e);
        }
     }