public static ImmutableSet<AnnotationMirror> getAnnotatedAnnotations(
      Element element, String annotationName) {
    return element.getAnnotationMirrors().stream()
        .filter(input -> isAnnotationPresent(input.getAnnotationType().asElement(), annotationName))
        .collect(toImmutableSet());
  }
Returns all {@linkplain AnnotationMirror annotations} that are present on the given {@link
Element} which are themselves annotated with an annotation whose type's canonical name is
{@code annotationName}.
common/src/main/java/com/google/auto/common/AnnotationMirrors.java