private static boolean canBeClass(@NotNull PsiJavaCodeReferenceElement ref) {
    PsiElement parent = ref.getParent();
    if (parent instanceof PsiMethodCallExpression) return false;
    if (!(ref instanceof PsiReferenceExpression)) return true;
    if (parent instanceof PsiReferenceExpression && ((PsiReferenceExpression)parent).getQualifierExpression() == ref) return true;
    return false;
  }
private static boolean canBeClass(@NotNull PsiJavaCodeReferenceElement ref)