public static boolean isAnnotationPresent(
      Element element, Class<? extends Annotation> annotationClass) {
    return getAnnotationMirror(element, annotationClass).isPresent();
  }
Returns {@code true} iff the given element has an {@link AnnotationMirror} whose {@linkplain
AnnotationMirror#getAnnotationType() annotation type} has the same canonical name as that of
{@code annotationClass}. This method is a safer alternative to calling {@link
Element#getAnnotation} and checking for {@code null} as it avoids any interaction with
annotation proxies.
common/src/main/java/com/google/auto/common/MoreElements.java