@Test
  public void properlySkipsMissingAnnotations_generatesClass() {
    JavaFileObject source =
        JavaFileObjects.forSourceLines(
            "test.ValidInRound2",
            "package test;",
            "",
            "@" + AnAnnotation.class.getCanonicalName(),
            "public class ValidInRound2 {",
            "  ValidInRound1XYZ vir1xyz;",
            "  @" + AnAnnotation.class.getCanonicalName(),
            "  static class ValidInRound1 {}",
            "}");
    Compilation compilation =
        javac().withProcessors(new MissingAnnotationProcessor()).compile(source);
    assertThat(compilation).succeeded();
    assertThat(compilation).generatedSourceFile("test.ValidInRound2XYZ");
  }
In the following example, at least open-jdk does not report the second method if {@code
SomeGeneratedClass} references a {@link TypeKind#ERROR} when {@link
RoundEnvironment#getElementsAnnotatedWith} is called, or even when {@link
TypeElement#getEnclosedElements()} is called. Therefore, our implementation should be vigilant
that the second method is captured for processing at some point.

<p>Note that for a method to get "hidden" like this, it should reside after the ERROR
referencing method, and it should not have any distinguishing characteristic like different
name, different number of parameter, or a clear parameter type mismatch.
common/src/test/java/com/google/auto/common/BasicAnnotationProcessorTest.java