protected Collection<Cache> getCaches(CacheOperation operation) {
   Set<String> cacheNames = operation.getCacheNames();
   Collection<Cache> caches = new ArrayList<Cache>(cacheNames.size());
   for (String name : cacheNames) {
     Cache cache = getCacheManager().getCache(name);
     if (cache == null) {
       throw new IllegalArgumentException(
           "Cannot find cache named [" + name + "] for " + operation);
     }
     caches.add(cache);
   }
   return caches;
 }
    /**
     * Apply the defaults to the specified {@link CacheOperation}.
     *
     * @param operation the operation to update
     */
    public void applyDefault(CacheOperation operation) {
      if (operation.getCacheNames().isEmpty() && this.cacheNames != null) {
        operation.setCacheNames(this.cacheNames);
      }
      if (!StringUtils.hasText(operation.getKey())
          && !StringUtils.hasText(operation.getKeyGenerator())
          && StringUtils.hasText(this.keyGenerator)) {
        operation.setKeyGenerator(this.keyGenerator);
      }

      if (StringUtils.hasText(operation.getCacheManager())
          || StringUtils.hasText(operation.getCacheResolver())) {
        // One of these is set so we should not inherit anything
      } else if (StringUtils.hasText(this.cacheResolver)) {
        operation.setCacheResolver(this.cacheResolver);
      } else if (StringUtils.hasText(this.cacheManager)) {
        operation.setCacheManager(this.cacheManager);
      }
    }