PsiClass (PsiMember member) { ProgressManager.getInstance().runProcess(() -> { final Query<PsiReference> query = member instanceof PsiMethod method ? MethodReferencesSearch.search(method) : ReferencesSearch.search(member); if (!query.forEach(this)) { foundClass.set(null); } }, null); return foundClass.get(); }