static void checkInstanceOfApplicable(@NotNull PsiInstanceOfExpression expression, @NotNull Consumer<? super HighlightInfo.Builder> errorSink) {
    PsiExpression operand = expression.getOperand();
    PsiTypeElement typeElement = InstanceOfUtils.findCheckTypeElement(expression);
    if (typeElement == null) return;
    PsiType checkType = typeElement.getType();
    PsiType operandType = operand.getType();
    if (operandType == null) return;
    boolean operandIsPrimitive = TypeConversionUtil.isPrimitiveAndNotNull(operandType);
    boolean checkIsPrimitive = TypeConversionUtil.isPrimitiveAndNotNull(checkType);
    boolean convertible = TypeConversionUtil.areTypesConvertible(operandType, checkType);
    boolean primitiveInPatternsEnabled = PsiUtil.isAvailable(JavaFeature.PRIMITIVE_TYPES_IN_PATTERNS, expression);
    if (((operandIsPrimitive || checkIsPrimitive) && !primitiveInPatternsEnabled) || !convertible) {
      if (!convertible && IncompleteModelUtil.isIncompleteModel(expression) &&
          IncompleteModelUtil.isPotentiallyConvertible(checkType, operand)) {
        return;
      }
      String message = JavaErrorBundle.message("inconvertible.type.cast", JavaHighlightUtil.formatType(operandType), JavaHighlightUtil
        .formatType(checkType));
      HighlightInfo.Builder info =
        HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message);
      if (checkIsPrimitive) {
        IntentionAction action = getFixFactory().createReplacePrimitiveWithBoxedTypeAction(operandType, typeElement);
        if (action != null) {
          info.registerFix(action, null, null, null, null);
        }
      }

      if (((operandIsPrimitive || checkIsPrimitive) && !primitiveInPatternsEnabled) && convertible) {
        registerIncreaseLanguageLevelFixes(expression, JavaFeature.PRIMITIVE_TYPES_IN_PATTERNS, info);
      }

      errorSink.accept(info);
      return;
    }
    PsiPrimaryPattern pattern = expression.getPattern();
    if (pattern instanceof PsiDeconstructionPattern deconstruction) {
      PatternHighlightingModel.createDeconstructionErrors(deconstruction, errorSink);
    }
  }
static void checkInstanceOfApplicable(@NotNull PsiInstanceOfExpression expression, @NotNull Consumer<? super HighlightInfo.Builder> errorSink)