code: static List<Annotation> getAnnotations(AnnotatedElement element, EnumSet<FindOption> findOptions,
                                             Predicate<Annotation> collectingFilter) {
          requireNonNull(element, "element");
          requireNonNull(collectingFilter, "collectingFilter");
  
          final Builder<Annotation> builder = new 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();
      }
docs: 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