Utils { public static <T extends Annotation> boolean hasAnnotation(Class<?> clazz, Class<T> annotationClass) { return clazz.getAnnotation(annotationClass) != null; }  static boolean hasAnnotation(Class<?> clazz, Class<T> annotationClass); static void checkArgument(boolean expression); static T checkNotNull(T reference, String errorMessage, Object... args);  }
@Test public void hasAnnotation() { Assert.assertTrue(Utils.hasAnnotation(ClassWithAnnotation.class, Controller.class)); }
@Test public void doesNotHaveAnnotation() { Assert.assertFalse(Utils.hasAnnotation(ClassWithoutAnnotation.class, Controller.class)); }