@SuppressWarnings("unchecked")
  private void addOrChangeConstructors(
      AbstractTypeDeclaration typeNode,
      AST ast,
      ASTRewrite astRewrite,
      int positionOfLastMemberFieldFound) {
    List<MethodDeclaration> constructors = findAllConstructors(typeNode);

    // Handle no constructors by creating an empty constructor
    if (constructors.isEmpty()) {
      MethodDeclaration constructor =
          typeNode.getAST().newMethodDeclaration();
      SimpleName name = ast.newSimpleName(typeNode.getName().getIdentifier());
      constructor.setName(name);
      Block body = ast.newBlock();
      constructor.setBody(body);
      constructor.setConstructor(true);
      List modifiers = constructor.modifiers();
      modifiers.add(ast.newModifier(ModifierKeyword.PUBLIC_KEYWORD));
      ListRewrite rewrite =
          astRewrite.getListRewrite(typeNode, typeNode
              .getBodyDeclarationsProperty());
      rewrite.insertAt(constructor, positionOfLastMemberFieldFound + 1, null);

      constructors.add(constructor);
    }
    for (MethodDeclaration constructor : constructors) {
      reWriteConstructor(ast, astRewrite, constructor);
    }
  }