@Test
  public void builtInExtensionsAreIsolating() {
    ImmutableList<AutoValueExtension> builtInExtensions =
        AutoValueProcessor.extensionsFromLoader(AutoValueProcessor.class.getClassLoader());
    // These are the current built-in extensions. We will update this test if we add more.
    // The (Object) cast is because otherwise the inferred type is Class<?>, and we can't match
    // that <?> with the class literals here. Even if we cast them to Class<?> it will be a
    // different <?>.
    assertThat(builtInExtensions)
        .comparingElementsUsing(transforming(e -> (Object) e.getClass(), "is class"))
        .containsExactly(
            MemoizeExtension.class,
            SerializableAutoValueExtension.class,
            ToPrettyStringExtension.class);

    AutoValueProcessor processor = new AutoValueProcessor(builtInExtensions);
    assertThat(processor.getSupportedOptions())
        .contains(IncrementalAnnotationProcessorType.ISOLATING.getProcessorOption());
  }
Tests of Gradle incrementality in the presence of extensions. See <a
href="https://docs.gradle.org/5.0/userguide/java_plugin.html#sec:incremental_annotation_processing">
incremental annotation processing</a> in the Gradle user guide.
value/src/test/java/com/google/auto/value/processor/IncrementalExtensionTest.java