boolean (PsiExpression expression) { if (!(expression instanceof PsiInstanceOfExpression instanceOfExpression)) { return false; } final PsiTypeElement typeElement = instanceOfExpression.getCheckType(); return !ignoreInstanceofOnLibraryClasses || typeElement == null || !LibraryUtil.isTypeInLibrary(typeElement.getType()); }