class UpdateMultiCacheAdvice extends MultiCacheAdvice {

    void updateCache(final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData data,
            final SerializationType serializationType) {
        if (returnList.size() != cacheKeys.size()) {
            throw new InvalidAnnotationException(String.format(
                    "The key generation objects, and the resulting objects do not match in size for [%s].", methodToCache.toString()));
        }

        Iterator<Object> returnListIter = returnList.iterator();
        Iterator<String> cacheKeyIter = cacheKeys.iterator();
        String cacheKey;
        Object result, cacheObject;
        while (returnListIter.hasNext()) {
            result = returnListIter.next();
            cacheKey = cacheKeyIter.next();
            cacheObject = getCacheBase().getSubmission(result);
            getCacheBase().getCache(data).setSilently(cacheKey, data.getExpiration(), cacheObject, serializationType);
        }
    }

}