@Override
    String wrap(ChainVariable outVar, String code, StreamToLoopReplacementContext context) {
      String bound = myBound.getText();
      if(needBound(context, bound)) {
        bound = context.declare("bound", outVar.getType().getCanonicalText(), bound);
      }
      String loopVar = outVar.getName();
      String reassign = "";
      if (outVar.isFinal()) {
        loopVar = context.registerVarName(Arrays.asList("i", "j", "idx"));
        reassign = outVar.getDeclaration(loopVar);
      }
      return context.getLoopLabel() +
             "for(" + outVar.getType().getCanonicalText() + " " + loopVar + " = " + myOrigin.getText() + ";" +
             loopVar + (myInclusive ? "<=" : "<") + bound + ";" +
             loopVar + "++) {\n" +
             reassign +
             code + "}\n";
    }
@Override
    String wrap(ChainVariable outVar, String code, StreamToLoopReplacementContext context)