@Override
  protected void createForLoopDeclaration(PsiForeachStatement statement,
                                          boolean isArray,
                                          String iteratedValueText,
                                          final String indexText,
                                          StringBuilder newStatement) {
    final String lengthText = isArray
                              ? createVariableName(iteratedValueText + "Length", PsiTypes.intType(), statement)
                              : createVariableName(iteratedValueText + "Size", PsiTypes.intType(), statement);

    newStatement.append("for(int ");
    newStatement.append(indexText);
    newStatement.append("=0,");
    newStatement.append(lengthText);
    newStatement.append('=');
    newStatement.append(iteratedValueText);
    newStatement.append(isArray ? ".length;" : ".size();");
    newStatement.append(indexText);
    newStatement.append('<');
    newStatement.append(lengthText);
    newStatement.append(';');
    newStatement.append(indexText);
    newStatement.append("++){");
  }
@Override
  protected void createForLoopDeclaration(PsiForeachStatement statement,
                                          boolean isArray,
                                          String iteratedValueText,
                                          final String indexText,
                                          StringBuilder newStatement)