boolean (PsiExpression expression, PsiVariable indexVariable, PsiVariable arrayVariable) { expression = PsiUtil.skipParenthesizedExprDown(expression); if (!(expression instanceof PsiArrayAccessExpression arrayAccess)) { return false; } final PsiExpression indexExpression = arrayAccess.getIndexExpression(); if (!ExpressionUtils.isReferenceTo(indexExpression, indexVariable)) { return false; } final PsiExpression arrayExpression = PsiUtil.skipParenthesizedExprDown(arrayAccess.getArrayExpression()); if (!(arrayExpression instanceof PsiReferenceExpression referenceExpression)) { return false; } final PsiExpression qualifier = PsiUtil.skipParenthesizedExprDown(referenceExpression.getQualifierExpression()); if (qualifier != null && !(qualifier instanceof PsiThisExpression) && !(qualifier instanceof PsiSuperExpression)) { return false; } final PsiElement target = referenceExpression.resolve(); return arrayVariable.equals(target); }