public static boolean resolvesToClass(@Nullable PsiElement expression) {
    if (!(expression instanceof GrQualifiedReference)) return false;
    return isClassReference(expression) || ((GrQualifiedReference<?>)expression).resolve() instanceof PsiClass;
  }
public static boolean resolvesToClass(@Nullable PsiElement expression)