docs: public static boolean hasAnnotation(Symbol sym, String annotationClass, VisitorState state) {
      if (sym == null) {
        return false;
      }
      // normalize to non-binary names
      annotationClass = annotationClass.replace('$', '.');
      Name annotationName = state.getName(annotationClass);
      if (hasAttribute(sym, annotationName)) {
        return true;
      }
      if (isInherited(state, annotationClass)) {
        while (sym instanceof ClassSymbol) {
          if (hasAttribute(sym, annotationName)) {
            return true;
          }
          sym = ((ClassSymbol) sym).getSuperclass().tsym;
        }
      }
      return false;
    }