private static boolean isFullyQualified(@NotNull CompositeElement classRef) {
    while (true) {
      ASTNode qualifier = classRef.findChildByRole(ChildRole.QUALIFIER);
      if (qualifier == null) return false;
      if (qualifier.getElementType() != JavaElementType.REFERENCE_EXPRESSION) return false;
      PsiElement refElement = ((PsiReference)qualifier).resolve();
      if (refElement instanceof PsiPackage) return true;
      classRef = (CompositeElement)qualifier;
    }
  }
private static boolean isFullyQualified(@NotNull CompositeElement classRef)