private static boolean isListElementDeclaration(PsiStatement statement, PsiVariable listVariable,
                                                    PsiVariable indexVariable) {
      if (!(statement instanceof PsiDeclarationStatement declarationStatement)) {
        return false;
      }
      final PsiElement[] declaredElements = declarationStatement.getDeclaredElements();
      if (declaredElements.length != 1) {
        return false;
      }
      final PsiElement declaredElement = declaredElements[0];
      if (!(declaredElement instanceof PsiVariable variable)) {
        return false;
      }
      final PsiExpression initializer = variable.getInitializer();
      return isListGetLookup(initializer, indexVariable, listVariable);
    }
private static boolean isListElementDeclaration(PsiStatement statement, PsiVariable listVariable,
                                                    PsiVariable indexVariable)