private void processAnnotations(
      Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {

    Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(AutoService.class);

    log(annotations.toString());
    log(elements.toString());

    for (Element e : elements) {
      // TODO(gak): check for error trees?
      TypeElement providerImplementer = MoreElements.asType(e);
      AnnotationMirror annotationMirror = getAnnotationMirror(e, AutoService.class).get();
      ImmutableSet<DeclaredType> providerInterfaces = getValueFieldOfClasses(annotationMirror);
      if (providerInterfaces.isEmpty()) {
        error(MISSING_SERVICES_ERROR, e, annotationMirror);
        continue;
      }
      for (DeclaredType providerInterface : providerInterfaces) {
        TypeElement providerType = MoreTypes.asTypeElement(providerInterface);

        log("provider interface: " + providerType.getQualifiedName());
        log("provider implementer: " + providerImplementer.getQualifiedName());

        if (checkImplementer(providerImplementer, providerType, annotationMirror)) {
          providers.put(getBinaryName(providerType), getBinaryName(providerImplementer));
        } else {
          String message =
              "ServiceProviders must implement their service provider interface. "
                  + providerImplementer.getQualifiedName()
                  + " does not implement "
                  + providerType.getQualifiedName();
          error(message, e, annotationMirror);
        }
      }
    }
  }
<ol>
  <li>For each class annotated with {@link AutoService}
      <ul>
        <li>Verify the {@link AutoService} interface value is correct
        <li>Categorize the class by its service interface
      </ul>
  <li>For each {@link AutoService} interface
      <ul>
        <li>Create a file named {@code META-INF/services/<interface>}
        <li>For each {@link AutoService} annotated class for this interface
            <ul>
              <li>Create an entry in the file
            </ul>
      </ul>
</ol>
service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java