AnnotationUtil { static <T extends Annotation> List<T> find(AnnotatedElement element, Class<T> annotationType, FindOption... findOptions) { return find(element, annotationType, EnumSet.copyOf( ImmutableList.copyOf(requireNonNull(findOptions, "findOptions")))); } private  AnnotationUtil();   }
@Test public void lookupMetaAnnotations_declared() { List<TestMetaAnnotation> list; for (final Class<?> clazz : ImmutableList.of(TestClass.class, TestChildClass.class, TestGrandChildClass.class)) { list = find(clazz, TestMetaAnnotation.class, EnumSet.of(FindOption.LOOKUP_META_ANNOTATIONS)); assertThat(list).hasSize(2); assertThat(list.get(0).value()).isEqualTo("TestRepeatables"); assertThat(list.get(1).value()).isEqualTo("TestAnnotation"); } for (final Class<?> clazz : ImmutableList.of(SingleRepeatableTestClass.class, SingleRepeatableTestChildClass.class, SingleRepeatableTestGrandChildClass.class)) { list = find(clazz, TestMetaAnnotation.class, EnumSet.of(FindOption.LOOKUP_META_ANNOTATIONS)); assertThat(list).hasSize(1); assertThat(list.get(0).value()).isEqualTo("TestRepeatable"); } }