BaseAnnotationHandler implements AnnotationHandler { final <A extends Annotation> A findAnnotation(final Class<A> classOfAnnotation) { return FragmentAnnotations.obtainAnnotationFrom(classOfAnnotation, annotatedClass, null); } BaseAnnotationHandler(@NonNull final Class<?> annotatedClass); @Override @NonNull final Class<?> getAnnotatedClass();  }
@Test public void testFindAnnotation() { assertThat( new TestHandler(Component.class).findAnnotation(ComponentAnnotation.class), is(FragmentAnnotations.obtainAnnotationFrom(ComponentAnnotation.class, Component.class, null)) ); assertThat( new TestHandler(AnnotatedComponent.class).findAnnotation(ComponentAnnotation.class), is(FragmentAnnotations.obtainAnnotationFrom(ComponentAnnotation.class, AnnotatedComponent.class, null)) ); }