code: private static void findAnnotatedElements(
        Element element,
        Set<? extends Class<? extends Annotation>> annotationClasses,
        ImmutableSetMultimap.Builder<Class<? extends Annotation>, Element> annotatedElements) {
      for (Element enclosedElement : element.getEnclosedElements()) {
        if (!enclosedElement.getKind().isClass() && !enclosedElement.getKind().isInterface()) {
          findAnnotatedElements(enclosedElement, annotationClasses, annotatedElements);
        }
      }
  
      // element.getEnclosedElements() does NOT return parameter elements
      if (element instanceof ExecutableElement) {
        for (Element parameterElement : ((ExecutableElement) element).getParameters()) {
          findAnnotatedElements(parameterElement, annotationClasses, annotatedElements);
        }
      }
      for (Class<? extends Annotation> annotationClass : annotationClasses) {
        if (isAnnotationPresent(element, annotationClass)) {
          annotatedElements.put(annotationClass, element);
        }
      }
    }
docs: Adds {@code element} and its enclosed elements to {@code annotatedElements} if they are
  annotated with any annotations in {@code annotationClasses}. Does not traverse to member types
  of {@code element}, so that if {@code Outer} is passed in the example below, looking for
  {@code @X}, then {@code Outer}, {@code Outer.foo}, and {@code Outer.foo()} will be added to the
  multimap, but neither {@code Inner} nor its members will.
  
  <pre><code>
  {@literal @}X class Outer {
  {@literal @}X Object foo;
  {@literal @}X void foo() {}
  {@literal @}X static class Inner {
  {@literal @}X Object bar;
  {@literal @}X void bar() {}
  }
  }
  </code></pre>