### Question:
UpdateMultiCacheAdvice extends CacheBase { protected void updateCache(final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData annotationData) { 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() )); } for (int ix = 0; ix < returnList.size(); ix++) { final Object result = returnList.get(ix); final String cacheKey = cacheKeys.get(ix); final Object cacheObject = result != null ? result : new PertinentNegativeNull(); cache.set(cacheKey, annotationData.getExpiration(), cacheObject); } }  @Pointcut("@annotation(net.nelz.simplesm.api.UpdateMultiCache)") void updateMulti(); @AfterReturning(pointcut="updateMulti()", returning="retVal") Object cacheUpdateSingle(final JoinPoint jp, final Object retVal);  }### Answer:
@Test public void testUpdateCache() throws Exception { final Method method = AnnotationTest.class.getMethod("cacheMe01", String.class); final UpdateMultiCache annotation = method.getAnnotation(UpdateMultiCache.class); final AnnotationData data = AnnotationDataBuilder.buildAnnotationData(annotation, UpdateMultiCache.class, method); final List<String> keys = new ArrayList<String>(); final List<Object> objs = new ArrayList<Object>(); keys.add("Key1-" + System.currentTimeMillis()); keys.add("Key2-" + System.currentTimeMillis()); try { cut.updateCache(keys, objs, method, data); fail("Expected Exception."); } catch (InvalidAnnotationException ex) { assertTrue(ex.getMessage().contains("do not match in size")); } final MemcachedClientIF cache = EasyMock.createMock(MemcachedClientIF.class); cut.setCache(cache); for (final String key : keys) { final String value = "ValueFor-" + key; objs.add(value); EasyMock.expect(cache.set(key, data.getExpiration(), value)).andReturn(null); } keys.add("BigFatNull"); objs.add(null); EasyMock.expect(cache.set(keys.get(2), data.getExpiration(), new PertinentNegativeNull())).andReturn(null); EasyMock.replay(cache); cut.updateCache(keys, objs, method, data); EasyMock.verify(cache); }