### Question:
ClassUtils { public static <T extends Annotation> T getAnnotation(Class<?> clazz, Class<T> annotationClass) { T annotation = clazz.getAnnotation(annotationClass); if(annotation == null && clazz.getSuperclass() != Object.class) { return getAnnotation(clazz.getSuperclass(), annotationClass); } else { return annotation; } } private  ClassUtils(); static T getAnnotation(Class<?> clazz, Class<T> annotationClass);  }### Answer:
@Test public void shouldResolveAnnotationFromParent() { NotInherited ni = ClassUtils.getAnnotation(Sub.class, NotInherited.class); assertThat(ni).isNotNull(); }
@Test public void shouldReturnNullOnMissingAnnotation() { ApplicationScoped as = ClassUtils.getAnnotation(Sub.class, ApplicationScoped.class); assertThat(as).isNull(); }