@Override
    String wrap(ChainVariable inVar, ChainVariable outVar, String code, StreamToLoopReplacementContext context) {
      if(!myVarName.equals(inVar.getName())) {
        rename(myVarName, inVar.getName(), context);
      }
      StreamToLoopReplacementContext innerContext = new StreamToLoopReplacementContext(context, myRecords);
      String replacement = code;
      for(StreamToLoopInspection.OperationRecord or : StreamEx.ofReversed(myRecords)) {
        replacement = or.myOperation.wrap(or.myInVar, or.myOutVar, replacement, innerContext);
      }
      if (myCondition != null) {
        String conditionText = myCondition.getText();
        if (myInverted) {
          conditionText = BoolUtils.getNegatedExpressionText(myCondition);
        }
        return "if(" + conditionText + "){\n" + replacement + "}\n";
      }
      return replacement;
    }
@Override
    String wrap(ChainVariable inVar, ChainVariable outVar, String code, StreamToLoopReplacementContext context)