### Question:
AnnotationHelper { public static boolean hasAnnotation(Class clazz, String annotationClass) { for (Annotation annot : clazz.getDeclaredAnnotations()) if (annot.annotationType().getName().equals(annotationClass)) return true; return false; }  static boolean hasAnnotation(Class clazz, String annotationClass); static boolean hasAnnotation(CtClass clazz, String annotationClass);  }### Answer:
@Test public void testHasAnnotationClass() throws Exception { assertTrue(AnnotationHelper.hasAnnotation(AnonymousClassPatchPlugin.class, "org.hotswap.agent.annotation.Plugin")); assertFalse(AnnotationHelper.hasAnnotation(AnonymousClassPatchPlugin.class, "xxxx")); }
@Test public void testHasAnnotationJavassist() throws Exception { ClassPool ctPool = ClassPool.getDefault(); CtClass ctClass = ctPool.getCtClass(AnonymousClassPatchPlugin.class.getName()); assertTrue(AnnotationHelper.hasAnnotation(ctClass, "org.hotswap.agent.annotation.Plugin")); assertFalse(AnnotationHelper.hasAnnotation(ctClass, "xxxx")); }