private static ImmutableSetMultimap<String, Element> toClassNameKeyedMultimap(
      SetMultimap<TypeElement, Element> elements) {
    ImmutableSetMultimap.Builder<String, Element> builder = ImmutableSetMultimap.builder();
    elements
        .asMap()
        .forEach(
            (annotation, element) ->
                builder.putAll(annotation.getQualifiedName().toString(), element));
    return builder.build();
  }
Returns the nearest enclosing {@link TypeElement} to the current element, throwing an {@link
IllegalArgumentException} if the provided {@link Element} is not enclosed by a type.
common/src/main/java/com/google/auto/common/BasicAnnotationProcessor.java