boolean (Object element, PsiElement context) { if(element == null) return false; if (element instanceof PsiType) return myType.isAssignableFrom((PsiType) element); PsiSubstitutor substitutor = null; if(element instanceof CandidateInfo info){ substitutor = info.getSubstitutor(); element = info.getElement(); } PsiType typeByElement = FilterUtil.getTypeByElement((PsiElement)element, context); if(substitutor != null) typeByElement = substitutor.substitute(typeByElement); return typeByElement != null && typeByElement.isAssignableFrom(myType) && !typeByElement.equals(myType); }