private boolean referencesPackage(@NotNull PsiElement element) {
    return element instanceof PsiPackage && checkName((PsiNamedElement)element) && resolvesTo(element);
  }
private boolean referencesPackage(@NotNull PsiElement element)