code: public static boolean isAnnotationPresent(Annotation[] annotations,
        Class<? extends Annotation> cls) {
      for (Annotation annotation : annotations) {
        if (cls.isInstance(annotation)) {
          return true;
        }
      }
      return false;
    }
docs: Returns true if {@code annotations} contains an instance of {@code cls}.