public static void replaceExpression(GrExpression expression, @NlsSafe String newExpression) {
    final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(expression.getProject());
    final GrExpression newCall = factory.createExpressionFromText(newExpression, expression.getContext());
    expression.replaceWithExpression(newCall, true);
  }
public static void replaceExpression(GrExpression expression, @NlsSafe String newExpression)