private boolean checkImplementer(
      TypeElement providerImplementer,
      TypeElement providerType,
      AnnotationMirror annotationMirror) {

    if (!Boolean.parseBoolean(processingEnv.getOptions().getOrDefault("verify", "true"))
        || suppresses(providerImplementer, "AutoService")) {
      return true;
    }

    // We check that providerImplementer does indeed inherit from providerType, and that it is not
    // abstract (an abstract class or interface). For ServiceLoader, we could also check that it has
    // a public no-arg constructor. But it turns out that people also use AutoService in contexts
    // where the META-INF/services entries are read by things other than ServiceLoader. Those things
    // still require the class to exist and inherit from providerType, but they don't necessarily
    // require a public no-arg constructor.
    // More background: https://github.com/google/auto/issues/1505.

    Types types = processingEnv.getTypeUtils();

    if (types.isSubtype(providerImplementer.asType(), providerType.asType())) {
      return checkNotAbstract(providerImplementer, annotationMirror);
    }

    // Maybe the provider has generic type, but the argument to @AutoService can't be generic.
    // So we allow that with a warning, which can be suppressed with @SuppressWarnings("rawtypes").
    // See https://github.com/google/auto/issues/870.
    if (types.isSubtype(providerImplementer.asType(), types.erasure(providerType.asType()))) {
      if (!suppresses(providerImplementer, "rawtypes")) {
        warning(
            "Service provider "
                + providerType
                + " is generic, so it can't be named exactly by @AutoService."
                + " If this is OK, add @SuppressWarnings(\"rawtypes\").",
            providerImplementer,
            annotationMirror);
      }
      return checkNotAbstract(providerImplementer, annotationMirror);
    }

    String message =
        "ServiceProviders must implement their service provider interface. "
            + providerImplementer.getQualifiedName()
            + " does not implement "
            + providerType.getQualifiedName();
    error(message, providerImplementer, annotationMirror);

    return false;
  }
Verifies {@link ServiceProvider} constraints on the concrete provider class. Note that these
constraints are enforced at runtime via the ServiceLoader, we're just checking them at compile
time to be extra nice to our users.
service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java