### Question:
Annotations { public static <A extends Annotation> Set<AnnotatedAnnotation<A>> getAnnotationsAnnotatedWith(AnnotatedElement annotatedElement, Class<A> annotationType) { return getAnnotationsAnnotatedWith(annotatedElement, annotationType, new LinkedHashSet<>()); } private  Annotations(); static Set<AnnotatedAnnotation<A>> getAnnotationsAnnotatedWith(AnnotatedElement annotatedElement, Class<A> annotationType);  }### Answer:
@Test void search_annotated_annotations() { Set<Annotations.AnnotatedAnnotation<MarkingAnnotation>> annotationSet = Annotations.getAnnotationsAnnotatedWith(SampleAnnotatedClass.class, MarkingAnnotation.class); assertThat(annotationSet) .as("Annotated annotations") .hasSize(2) .are(new Condition<>( aa -> isAnnotationOfType(aa.parentAnnotation(), MarkingAnnotation.class), "@MarkingAnnotation is always the parent") ) .<Class<? extends Annotation>>extracting(aa -> aa.annotation().annotationType()) .containsOnly(AnnotatedAnnotation1.class, AnnotatedAnnotation2.class); }