AnnotationFilter implements Filter<Class<?>> { @Override public boolean accept(Class<?> type) { if (type != null) { if (this.forceInheritence) { Annotation annotation = this.annotationUtil.getTypeAnnotation(type, this.annotationType); return (annotation != null); } else { return type.isAnnotationPresent(this.annotationType); } } return false; } AnnotationFilter(Class<? extends Annotation> annotationType);  AnnotationFilter(Class<? extends Annotation> annotationType, boolean forceInheritence);  AnnotationFilter(Class<? extends Annotation> annotationType, boolean forceInheritence,
      AnnotationUtilImpl annotationUtil); @Override boolean accept(Class<?> type);  }
@Test public void testFilter() { AnnotationFilter filter = new AnnotationFilter(Resource.class); assertFalse(filter.accept(null)); assertTrue(filter.accept(TestClass1.class)); assertFalse(filter.accept(TestClass2.class)); assertFalse(filter.accept(TestClass3.class)); filter = new AnnotationFilter(Resource.class, true); assertTrue(filter.accept(TestClass1.class)); assertFalse(filter.accept(TestClass2.class)); assertTrue(filter.accept(TestClass3.class)); }