PsiClass (@NotNull GrReferenceExpression ref) { GrExpression qualifier = ref.getQualifierExpression(); if (qualifier != null) { return (PsiClass)PsiUtil.getAccessObjectClass(qualifier).getElement(); } return null; }