@Override
    String wrap(ChainVariable inVar, ChainVariable outVar, String code, StreamToLoopReplacementContext context) {
      String list = context.registerVarName(Arrays.asList("toSort", "listToSort"));
      context.addAfterStep(new SourceOperation.ForEachSource(context.createExpression(list)).wrap(null, outVar, code, context));
      context.addAfterStep(list + ".sort(" + (myComparator == null ? "null" : myComparator.getText()) + ");\n");
      String listType = CommonClassNames.JAVA_UTIL_LIST + "<" + inVar.getType().getCanonicalText() + ">";
      String initializer = "new " + CommonClassNames.JAVA_UTIL_ARRAY_LIST + "<>()";
      context.addBeforeStep(listType + " " + list + "=" + initializer + ";");
      return list+".add("+inVar+");\n";
    }
@Override
    String wrap(ChainVariable inVar, ChainVariable outVar, String code, StreamToLoopReplacementContext context)