private ImmutableSet<AnnotationMirror> annotationsToAdd(Element element) {
      ImmutableSet<? extends AnnotationMirror> containers =
          AnnotationMirrors.getAnnotatedAnnotations(element, AnnotationsToApply.class);
      if (containers.size() > 1) {
        messager.printMessage(
            ERROR, "Multiple @AnnotationsToApply annotations are not supported", element);
      }
      return containers.stream()
          .limit(1)
          .map(elements::getElementValuesWithDefaults)
          .map(Map::values)
          .flatMap(Collection::stream)
          .map(AnnotationValue::getValue)
          .filter(AnnotationMirror.class::isInstance)
          // Any non-annotation element should already have been flagged when processing
          // @AnnotationsToApply
          .map(AnnotationMirror.class::cast)
          .collect(toImmutableSet());
    }
This is a value object that mirrors the static declaration of an {@link AutoFactory} annotation.

@author Gregory Kick
factory/src/main/java/com/google/auto/factory/processor/AutoFactoryDeclaration.java