GrStatement (VariableInfo[] infos, GrMethodCallExpression callExpression, final Project project) { StringBuilder text = new StringBuilder(); if (infos.length > 1) text.append('('); for (VariableInfo info : infos) { text.append(info.getName()).append(", "); } if (infos.length > 1) { text.replace(text.length() - 2, text.length(), ") ="); } else { text.replace(text.length() - 2, text.length(), " = "); } text.append(callExpression.getText()); return GroovyPsiElementFactory.getInstance(project).createExpressionFromText(text.toString()); }