static <T extends Annotation> List<T> find(AnnotatedElement element, Class<T> annotationType,
                                               Set<FindOption> findOptions) {
        requireNonNull(element, "element");
        requireNonNull(annotationType, "annotationType");

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

        // Repeatable is not a repeatable. So the length of the returning array is 0 or 1.
        final Repeatable[] repeatableAnnotations = annotationType.getAnnotationsByType(Repeatable.class);
        final Class<? extends Annotation> containerType =
                repeatableAnnotations.length > 0 ? repeatableAnnotations[0].value() : null;

        for (final AnnotatedElement e : resolveTargetElements(element, findOptions)) {
            for (final Annotation annotation : e.getDeclaredAnnotations()) {
                if (findOptions.contains(FindOption.LOOKUP_META_ANNOTATIONS)) {
                    findMetaAnnotations(builder, annotation, annotationType, containerType);
                }
                collectAnnotations(builder, annotation, annotationType, containerType);
            }
        }
        return builder.build();
    }
Returns all annotations of the {@code annotationType} searching from the specified {@code element}.
The search range depends on the specified {@link FindOption}s.

@param element the {@link AnnotatedElement} to find annotations
@param annotationType the type of the annotation to find
@param findOptions the options to be applied when finding annotations
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotationUtil.java