public static boolean isOffsetArrayAccess(@Nullable PsiExpression expression, @NotNull PsiVariable variable) {
    final PsiExpression strippedExpression = PsiUtil.skipParenthesizedExprDown(expression);
    if (!(strippedExpression instanceof PsiArrayAccessExpression arrayAccessExpression)) {
      return false;
    }
    final PsiExpression arrayExpression = arrayAccessExpression.getArrayExpression();
    if (VariableAccessUtils.variableIsUsed(variable, arrayExpression)) {
      return false;
    }
    final PsiExpression index = arrayAccessExpression.getIndexExpression();
    if (index == null) {
      return false;
    }
    return expressionIsOffsetVariableLookup(index, variable);
  }
public static boolean isOffsetArrayAccess(@Nullable PsiExpression expression, @NotNull PsiVariable variable)