boolean (@NotNull final String baseQName, @Nullable final PsiReferenceList extList, @NotNull JavaPsiFacade facade) { if (extList != null) { // in Cls class it's fast PsiJavaCodeReferenceElement[] referenceElements = extList.getReferenceElements(); if (referenceElements.length != 0) { GlobalSearchScope scope = extList.getResolveScope(); for (PsiJavaCodeReferenceElement ref : referenceElements) { if (Objects.equals(PsiNameHelper.getQualifiedClassName(ref.getQualifiedName(), false), baseQName) && facade.findClass(baseQName, scope) != null) return true; } } } return false; }