@SuppressWarnings("unchecked")
  private void reWriteConstructor(AST ast, ASTRewrite astRewrite,
      MethodDeclaration constructor) {
    SimpleName varType;
    SimpleName varName;
    SimpleType variableType;

    // Add a parameter
    varType = ast.newSimpleName(CREATED_VARIABLE_TYPE);
    varName = ast.newSimpleName(CREATED_VARIABLE_NAME);
    variableType = ast.newSimpleType(varType);
    SingleVariableDeclaration svd = ast.newSingleVariableDeclaration();
    svd.setName(varName);
    svd.modifiers().add(ast.newModifier(ModifierKeyword.FINAL_KEYWORD));
    svd.setType(variableType);
    ListRewrite parametersRewrite =
        astRewrite.getListRewrite(constructor,
            MethodDeclaration.PARAMETERS_PROPERTY);
    parametersRewrite.insertFirst(svd, null);

    // Add an assignment statement
    varName = ast.newSimpleName(CREATED_VARIABLE_NAME);
    Block block = constructor.getBody();
    Assignment assignment = ast.newAssignment();
    FieldAccess fieldAccess = ast.newFieldAccess();
    fieldAccess.setExpression(ast.newThisExpression());
    fieldAccess.setName(varName);
    assignment.setLeftHandSide(fieldAccess);
    varName = ast.newSimpleName(CREATED_VARIABLE_NAME);
    assignment.setRightHandSide(varName);
    ExpressionStatement expression = ast.newExpressionStatement(assignment);
    ListRewrite blockRewrite =
        astRewrite.getListRewrite(block, Block.STATEMENTS_PROPERTY);
    
    // We'll insert the assignment as the first thing after the super() invocation,
    // if any
    int positionToInsert = 0;
    List originalList = blockRewrite.getOriginalList();
    if (originalList.size() > 0) {
      Object foo = originalList.get(0);
      if (foo instanceof SuperConstructorInvocation) {
        positionToInsert++;
      }
      System.out.println(foo);
    }
    
    blockRewrite.insertAt(expression, positionToInsert, null);
  }