boolean (PsiForStatement statement, PsiLocalVariable indexVariable, ConditionType conditionType) { PsiStatement body = statement.getBody(); if (body == null) return true; return !StreamEx.ofTree((PsiElement)body, element -> StreamEx.of(element.getChildren())) .select(PsiReferenceExpression.class) .filter(expression -> expression.isReferenceTo(indexVariable)) .allMatch(expression -> { PsiElement parent = expression.getParent(); if ((parent instanceof PsiUnaryExpression psiUnaryExpression && ExpressionUtils.isReferenceTo(psiUnaryExpression.getOperand(), indexVariable)) || (parent instanceof PsiAssignmentExpression assignmentExpression && ExpressionUtils.isReferenceTo(assignmentExpression.getLExpression(), indexVariable))) { return notChangesMonotony(conditionType, tryCast(parent, PsiExpression.class)); } return true; }); }