### Question:
AnnotationUtils { @SuppressWarnings("unchecked") public static <A extends Annotation> A getMergedAnnotation(AnnotatedElement element, Class<A> target) { CacheKey cacheKey = new CacheKey(element, target); if (CACHE.containsKey(cacheKey)) { return (A) CACHE.get(cacheKey); } A annotation = getAnnotation(element, target); if (annotation != null) { return annotation; } List<Annotation> visted = new LinkedList<>(); annotation = (A) findMetaAnnotation(visted, element, target); if (annotation == null) { CACHE.put(cacheKey, null); return null; } String[] methodNames = Arrays.stream(target.getMethods()) .map(Method::getName) .toArray(String[]::new); Map<String, Object> memberValues = extractValues(visted, methodNames); Annotation proxy = getProxyAnnotation(target, annotation, memberValues); CACHE.put(cacheKey, proxy); return (A) proxy; }  static A getAnnotation(AnnotatedElement element, Class<A> target); @SuppressWarnings("unchecked") static A getMergedAnnotation(AnnotatedElement element, Class<A> target); static boolean isMetaAnnotation(Class<? extends Annotation> metaAnnotation); static boolean isAnnotationPresent(AnnotatedElement element, Class<A> target);  }### Answer:
@Test public void getMergedAnnotation() { A a = AnnotationUtils.getMergedAnnotation(Bean.class, A.class); assert a != null; assertEquals("hello", a.a()); Named named = AnnotationUtils.getMergedAnnotation(Bean.class, Named.class); assert named == null; named = AnnotationUtils.getMergedAnnotation(Bean.class, Named.class); assert named == null; }