void (@NotNull PsiForStatement statement) { super.visitForStatement(statement); final PsiStatement initialization = statement.getInitialization(); if (!(initialization instanceof PsiDeclarationStatement declaration)) return; final PsiElement[] declaredElements = declaration.getDeclaredElements(); if (declaredElements.length != 1) return; final PsiElement declaredElement = declaredElements[0]; if (!(declaredElement instanceof PsiLocalVariable variable)) return; final PsiExpression initialValue = variable.getInitializer(); if (initialValue == null) return; final PsiExpression condition = statement.getCondition(); if (!ExpressionUtils.isVariableLessThanComparison(condition, variable)) return; final PsiStatement update = statement.getUpdate(); if (!VariableAccessUtils.variableIsIncremented(variable, update)) return; final PsiArrayAccessExpression arrayAccessExpression = getArrayAccessExpression(statement); if (arrayAccessExpression == null) return; final PsiExpression arrayExpression = arrayAccessExpression.getArrayExpression(); final PsiType type = arrayExpression.getType(); if (!(type instanceof PsiArrayType) || type.getDeepComponentType() instanceof PsiPrimitiveType) return; final PsiStatement body = statement.getBody(); if (!bodyIsArrayToCollectionCopy(body, variable, true)) return; registerStatementError(statement); }