boolean (PsiExpression reference, PsiClass targetClass) { final PsiClass sourceClass = ClassUtils.getContainingClass(reference); return sourceClass != null && targetClass != null && sourceClass != targetClass && PsiUtil.getTopLevelClass(sourceClass) == PsiUtil.getTopLevelClass(targetClass); }