private void assertGeneratedMatches(
      Iterable<String> imports,
      Iterable<String> annotations,
      Iterable<String> expectedMethodAnnotations) {

    JavaFileObject javaFileObject =
        new InputFileBuilder().setImports(imports).addAnnotations(annotations).build();

    JavaFileObject expectedOutput =
        new OutputFileBuilder()
            .setImports(imports)
            .addMethodAnnotations(expectedMethodAnnotations)
            .build();

    Compilation compilation =
        javac()
            .withOptions("-A" + Nullables.NULLABLE_OPTION + "=")
            .withProcessors(new AutoValueProcessor())
            .compile(javaFileObject);
    assertThat(compilation).succeeded();
    assertThat(compilation)
        .generatedSourceFile("foo.bar.AutoValue_Baz")
        .hasSourceEquivalentTo(expectedOutput);
  }
Tests to ensure annotations are kept on AutoValue generated classes

@author jmcampanini
value/src/test/java/com/google/auto/value/processor/PropertyAnnotationsTest.java