String varName = codeStyleManager.suggestUniqueVariableName(suggestedNameInfo, methodCallExpression, false).names[0];
PsiExpression forEachBody =
elementFactory.createExpressionFromText(qualifierText + "add(" + varName + ")", qualifierExpression);
final String callText =
builder.append(".forEach(").append(varName).append("->").append(forEachBody.getText()).append(");").toString();
<BUG>PsiElement result = foreachStatement.replace(elementFactory.createStatementFromText(callText, foreachStatement));

simplifyAndFormat(project, result);</BUG>
}
private static String createInitializerReplacementText(PsiType varType, PsiExpression initializer) {

String varName = codeStyleManager.suggestUniqueVariableName(suggestedNameInfo, methodCallExpression, false).names[0];
PsiExpression forEachBody =
elementFactory.createExpressionFromText(qualifierText + "add(" + varName + ")", qualifierExpression);
final String callText =
builder.append(".forEach(").append(varName).append("->").append(forEachBody.getText()).append(");").toString();
return foreachStatement.replace(elementFactory.createStatementFromText(callText, foreachStatement));
}
private static String createInitializerReplacementText(PsiType varType, PsiExpression initializer) {
