boolean (PsiTypeElement operand) { if (operand == null) return false; PsiType type = operand.getType(); PsiClass containingClass = PsiTreeUtil.getParentOfType(operand, PsiClass.class); return containingClass != null && containingClass.isEquivalentTo(PsiUtil.resolveClassInClassTypeOnly(type)); }