private static @Nullable PsiVariable getApparentlyAccessedVariable(Project project, PsiElement element) {
      PsiClass containingClass = PsiUtil.getContainingClass(element);
      if (containingClass == null) return null;
      final PsiElement parent = containingClass.getParent();
      final PsiResolveHelper resolveHelper = JavaPsiFacade.getInstance(project).getResolveHelper();
      final String referenceText = element.getText();
      return resolveHelper.resolveAccessibleReferencedVariable(referenceText, parent);
    }
private static @Nullable PsiVariable getApparentlyAccessedVariable(Project project, PsiElement element)