public static Optional<AnnotationMirror> getAnnotationMirror(
      Element element, Class<? extends Annotation> annotationClass) {
    String name = annotationClass.getCanonicalName();
    if (name == null) {
      return Optional.absent();
    }
    return getAnnotationMirror(element, name);
  }
Returns an {@link AnnotationMirror} for the annotation of type {@code annotationClass} on
{@code element}, or {@link Optional#absent()} if no such annotation exists. This method is a
safer alternative to calling {@link Element#getAnnotation} as it avoids any interaction with
annotation proxies.
common/src/main/java/com/google/auto/common/MoreElements.java