@Override
  PsiElement migrate(@NotNull Project project, @NotNull PsiElement body, @NotNull TerminalBlock tb) {
    PsiStatement loopStatement = tb.getStreamSourceStatement();
    CollectTerminal terminal = extractCollectTerminal(tb, null);
    if (terminal == null) return null;
    CommentTracker ct = new CommentTracker();
    String stream = tb.generate(ct) + terminal.generateIntermediate(ct) + terminal.generateTerminal(ct, false);
    PsiElement toReplace = terminal.getElementToReplace();
    PsiElement result;
    if (toReplace != null) {
      result = ct.replace(toReplace, stream);
      terminal.cleanUp(ct);
      removeLoop(ct, loopStatement);
    }
    else {
      PsiVariable variable = terminal.getTargetVariable();
      LOG.assertTrue(variable != null);
      terminal.cleanUp(ct);
      result = replaceInitializer(loopStatement, variable, variable.getInitializer(), stream, terminal.getStatus(), ct);
    }
    return result;
  }
@Override
  PsiElement migrate(@NotNull Project project, @NotNull PsiElement body, @NotNull TerminalBlock tb)