code: public static String getCacheName(Method method, String methodCacheName, CacheDefaults cacheDefaultsAnnotation, boolean generate) {
        assertNotNull(method, "method parameter must not be null");
        assertNotNull(methodCacheName, "methodCacheName parameter must not be null");
  
        String cacheName = methodCacheName.trim();
  
        if (cacheName.isEmpty() && cacheDefaultsAnnotation != null) {
           cacheName = cacheDefaultsAnnotation.cacheName().trim();
        }
  
        if (cacheName.isEmpty() && generate) {
           cacheName = getDefaultMethodCacheName(method);
        }
  
        return cacheName;
     }
docs: Resolves the cache name of a method annotated with a JCACHE annotation.
  
  @param method                  the annotated method.
  @param methodCacheName         the cache name defined on the JCACHE annotation.
  @param cacheDefaultsAnnotation the {@link javax.cache.annotation.CacheDefaults} annotation instance.
  @param generate                {@code true} if the default cache name has to be returned if none is specified.
  @return the resolved cache name.
  @throws NullPointerException if method or methodCacheName parameter is {@code null}.