static HighlightInfo.Builder checkInstanceOfPatternSupertype(@NotNull PsiInstanceOfExpression expression) {
    @Nullable PsiPattern expressionPattern = expression.getPattern();
    PsiTypeTestPattern pattern = tryCast(expressionPattern, PsiTypeTestPattern.class);
    if (pattern == null) return null;
    PsiPatternVariable variable = pattern.getPatternVariable();
    if (variable == null) return null;
    PsiTypeElement typeElement = pattern.getCheckType();
    if (typeElement == null) return null;
    PsiType checkType = typeElement.getType();
    PsiType expressionType = expression.getOperand().getType();
    if (expressionType != null && checkType.isAssignableFrom(expressionType)) {
      String description =
        checkType.equals(expressionType) ?
        JavaErrorBundle.message("instanceof.pattern.equals", checkType.getPresentableText()) :
        JavaErrorBundle.message("instanceof.pattern.supertype", checkType.getPresentableText(), expressionType.getPresentableText());
      HighlightInfo.Builder info =
        HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(typeElement).descriptionAndTooltip(description);
      if (!VariableAccessUtils.variableIsUsed(variable, variable.getDeclarationScope())) {
        var action = new RedundantInstanceofFix(expression);
        info.registerFix(action, null, null, null, null);
      }
      return info;
    }
    return null;
  }
static HighlightInfo.Builder checkInstanceOfPatternSupertype(@NotNull PsiInstanceOfExpression expression)