title: Javapoet/JavaWriter append to existing class
body: <p>I have been experimenting with code generation in an annotation processor.</p>
  
  <p>Consider the following piece of code that adds a constructor that has a statement in it.</p>
  
  <pre><code>private void addRegister(ExecutableElement el) {
      MethodSpec builder = MethodSpec.constructorBuilder().addStatement("$T.register(this)", EventExecutor.class).build();
      TypeSpec spec = TypeSpec.classBuilder(el.getEnclosingElement().getSimpleName().toString()).addOriginatingElement(el).addMethod(builder).build();
      JavaFile file = JavaFile.builder(pEnv.getElementUtils().getPackageOf(el.getEnclosingElement()).getQualifiedName().toString(), spec).build();
      pEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, file.toString());
  }
  </code></pre>
  
  <p>Now, when given an executable element named "bla" in class "Test" the result is this:</p>
  
  <pre><code>class Test {
     Test() {
       EventExecutor.register(this);
     }
  }
  </code></pre>
  
  <p>However this class already exists and I want to append the constructor to the existing code rather than create this fresh class here.</p>
  
  <p>Existing code:</p>
  
  <pre><code>public class Test {
  
      @Event
      public void bla(TestEvent event) {
  
      }
  }
  </code></pre>
  
  <p>Can I do this?</p>