private static @Nullable @NonNls String buildSystemArrayCopyText(PsiForStatement forStatement, CommentTracker commentTracker) {
      final CountingLoop countingLoop = CountingLoop.from(forStatement);
      if (countingLoop == null) {
        return null;
      }
      final PsiExpression limit = countingLoop.getBound();
      final PsiExpression initializer = countingLoop.getInitializer();
      final String lengthText =
        countingLoop.isDescending()
        ? buildLengthText(initializer, limit, countingLoop.isIncluding(), commentTracker)
        : buildLengthText(limit, initializer, countingLoop.isIncluding(), commentTracker);
      if (lengthText == null) {
        return null;
      }
      final PsiArrayAccessExpression lhs = getLhsArrayAccessExpression(forStatement);
      if (lhs == null) {
        return null;
      }
      final PsiExpression lArray = lhs.getArrayExpression();
      final String toArrayText = commentTracker.text(lArray);
      final PsiArrayAccessExpression rhs = getRhsArrayAccessExpression(forStatement);
      if (rhs == null) {
        return null;
      }
      final PsiExpression rArray = rhs.getArrayExpression();
      final String fromArrayText = commentTracker.text(rArray);
      final PsiExpression rhsIndexExpression = PsiUtil.skipParenthesizedExprDown(rhs.getIndexExpression());
      final PsiExpression limitExpression = countingLoop.isDescending() ? limit : initializer;
      final String fromOffsetText = buildOffsetText(rhsIndexExpression, countingLoop.getCounter(), limitExpression,
                                                    countingLoop.isDescending() && !countingLoop.isIncluding(), commentTracker);
      final PsiExpression lhsIndexExpression = PsiUtil.skipParenthesizedExprDown(lhs.getIndexExpression());
      final String toOffsetText = buildOffsetText(lhsIndexExpression, countingLoop.getCounter(), limitExpression,
                                                  countingLoop.isDescending() && !countingLoop.isIncluding(), commentTracker);
      return "if(" + lengthText + ">=0)" +
             "System.arraycopy(" + fromArrayText + "," + fromOffsetText + "," + toArrayText + "," + toOffsetText + "," + lengthText + ");";
    }
private static @Nullable @NonNls String buildSystemArrayCopyText(PsiForStatement forStatement, CommentTracker commentTracker)