@Test
  public void propertyTypes() {
    JavaFileObject parent =
        JavaFileObjects.forSourceLines(
            "foo.bar.Parent",
            "package foo.bar;",
            "",
            "import java.util.List;",
            "",
            "interface Parent<T> {",
            "  T thing();",
            "  List<T> list();",
            "}");
    JavaFileObject autoValueClass =
        JavaFileObjects.forSourceLines(
            "foo.bar.Baz",
            "package foo.bar;",
            "",
            "import com.google.auto.value.AutoValue;",
            "",
            "@AutoValue",
            "abstract class Baz implements Parent<String> {",
            "}");
    ContextChecker checker =
        context -> {
          assertThat(context.builder()).isEmpty();
          Map<String, TypeMirror> propertyTypes = context.propertyTypes();
          assertThat(propertyTypes.keySet()).containsExactly("thing", "list");
          TypeMirror thingType = propertyTypes.get("thing");
          assertThat(thingType).isNotNull();
          assertThat(thingType.getKind()).isEqualTo(TypeKind.DECLARED);
          assertThat(MoreTypes.asTypeElement(thingType).getQualifiedName().toString())
              .isEqualTo("java.lang.String");
          TypeMirror listType = propertyTypes.get("list");
          assertThat(listType).isNotNull();
          assertThat(listType.toString()).isEqualTo("java.util.List<java.lang.String>");
        };
    ContextCheckingExtension extension = new ContextCheckingExtension(checker);
    Compilation compilation =
        javac()
            .withProcessors(new AutoValueProcessor(ImmutableList.of(extension)))
            .compile(autoValueClass, parent);
    assertThat(compilation).succeededWithoutWarnings();
  }
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