static List<Annotation> getAnnotations(AnnotatedElement element, EnumSet<FindOption> findOptions,
                                           Predicate<Annotation> collectingFilter) {
        requireNonNull(element, "element");
        requireNonNull(collectingFilter, "collectingFilter");

        final ImmutableList.Builder<Annotation> builder = ImmutableList.builder();

        for (final AnnotatedElement e : resolveTargetElements(element, findOptions)) {
            for (final Annotation annotation : e.getDeclaredAnnotations()) {
                if (findOptions.contains(FindOption.LOOKUP_META_ANNOTATIONS)) {
                    getMetaAnnotations(builder, annotation, collectingFilter);
                }
                if (collectingFilter.test(annotation)) {
                    builder.add(annotation);
                }
            }
        }
        return builder.build();
    }
Returns all annotations searching from the specified {@code element}. The search range depends on
the specified {@link FindOption}s and the specified {@code collectingFilter} decides whether
an annotation is collected or not.

@param element the {@link AnnotatedElement} to find annotations
@param findOptions the options to be applied when retrieving annotations
@param collectingFilter the predicate which decides whether the annotation is to be collected or not
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotationUtil.java