
@NotNull List<Operation> operations) {</BUG>
restoreComments(foreachStatement, body);
final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
<BUG>StringBuilder buffer = generateStream(iteratedValue, operations, true);
</BUG>
PsiElement block = tb.convertToElement(elementFactory);
buffer.append(".").append(myForEachMethodName).append("(");
final String functionalExpressionText = tb.getVariable().getName() + " -> " + wrapInBlock(block);
PsiExpressionStatement callStatement = (PsiExpressionStatement)elementFactory

void migrate(@NotNull Project project,
@NotNull ProblemDescriptor descriptor,
@NotNull PsiForeachStatement foreachStatement,
@NotNull PsiExpression iteratedValue,
@NotNull PsiStatement body,
@NotNull StreamApiMigrationInspection.TerminalBlock tb) {
restoreComments(foreachStatement, body);
final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
StringBuilder buffer = generateStream(iteratedValue, tb.getLastOperation(), true);
PsiElement block = tb.convertToElement(elementFactory);
buffer.append(".").append(myForEachMethodName).append("(");
final String functionalExpressionText = tb.getVariable().getName() + " -> " + wrapInBlock(block);
PsiExpressionStatement callStatement = (PsiExpressionStatement)elementFactory
