static @Nullable PsiClass findSurroundingClassWithHiddenField(PsiVariable variable,
                                                                boolean ignoreInvisibleFields,
                                                                boolean ignoreStaticHidingInstance) {
    PsiClass aClass = PsiUtil.getContainingClass(variable);
    final String variableName = variable.getName();
    if (variableName == null) {
      return null;
    }
    while (aClass != null) {
      final PsiField field = aClass.findFieldByName(variableName, true);
      if (field != null) {
        if (!ignoreInvisibleFields || ClassUtils.isFieldVisible(field, aClass)) {
          if (!ignoreStaticHidingInstance || field.hasModifierProperty(PsiModifier.STATIC) ||
              !CommonJavaRefactoringUtil.isInStaticContext(variable, aClass)) {
            return aClass;
          }
        }
      }
      aClass = PsiUtil.getContainingClass(aClass);
    }
    return null;
  }
static @Nullable PsiClass findSurroundingClassWithHiddenField(PsiVariable variable,
                                                                boolean ignoreInvisibleFields,
                                                                boolean ignoreStaticHidingInstance)