public static boolean isClassNamePossible(PsiElement position) {
    PsiElement parent = position.getParent();
    if (parent instanceof GrReferenceElement) {
      return ((GrReferenceElement<?>)parent).getQualifier() == null;
    }
    return couldContainReference(position);
  }
public static boolean isClassNamePossible(PsiElement position)