code: public static Optional<AnnotationMirror> findAnnotationMirror(
        Element element, String annotationClassName) {
      for (AnnotationMirror annotationMirror : element.getAnnotationMirrors()) {
        TypeElement annotationTypeElement =
            (TypeElement) (annotationMirror.getAnnotationType().asElement());
        if (annotationTypeElement.getQualifiedName().contentEquals(annotationClassName)) {
          return Optional.of(annotationMirror);
        }
      }
      return Optional.empty();
    }
docs: Returns an {@link AnnotationMirror} for the annotation of type {@code annotationClassName} on
  {@code element}, or {@link Optional#empty()} if no such annotation exists.