### Question:
UpdateMultiCacheAdvice extends CacheBase { protected List<Object> getKeyObjects(final int keyIndex, final Object returnValue, final JoinPoint jp, final Method methodToCache) throws Exception { final Object keyObject = keyIndex == -1 ? validateReturnValueAsKeyObject(returnValue, methodToCache) : getIndexObject(keyIndex, jp, methodToCache); if (verifyTypeIsList(keyObject.getClass())) { return (List<Object>) keyObject; } throw new InvalidAnnotationException(String.format( "The parameter object found at dataIndex [%s] is not a [%s]. " + "[%s] does not fulfill the requirements.", UpdateMultiCache.class.getName(), List.class.getName(), methodToCache.toString() )); }  @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 testGetKeyObjects() throws Exception { final Method method1 = AnnotationTest.class.getMethod("cacheMe02", null); try { cut.getKeyObjects(-1, "bubba", null, method1); } catch (InvalidAnnotationException ex) { assertTrue(true); } final Method method2 = AnnotationTest.class.getMethod("cacheMe03", null); final ArrayList<String> results = new ArrayList<String>(); results.add("gump"); cut.getKeyObjects(-1, results, null, method2); }