@Test
  public void finalAutoValueClassName() {
    JavaFileObject autoValueClass =
        JavaFileObjects.forSourceLines(
            "foo.bar.Baz",
            "package foo.bar;",
            "",
            "import com.google.auto.value.AutoValue;",
            "",
            "@AutoValue",
            "abstract class Baz {",
            "}");
    ContextChecker checker =
        context -> {
          assertThat(context.finalAutoValueClassName()).isEqualTo("foo.bar.AutoValue_Baz");
        };
    ContextCheckingExtension extension = new ContextCheckingExtension(checker);
    Compilation compilation =
        javac()
            .withProcessors(
                new AutoValueProcessor(ImmutableList.of(extension, new FinalExtension())))
            .compile(autoValueClass);
    assertThat(compilation).succeededWithoutWarnings();
    assertThat(compilation).generatedSourceFile("foo.bar.AutoValue_Baz");
    // ContextCheckingExtension doesn't generate any code, so that name must be the class generated
    // by FinalExtension.
  }
Tests that extensions providing their own implemented annotation types or options get picked
up.
value/src/test/java/com/google/auto/value/processor/ExtensionTest.java