static HighlightInfo.Builder checkUnnamedVariableDeclaration(@NotNull PsiVariable variable) {
    if (isArrayDeclaration(variable)) {
      IntentionAction fix = new NormalizeBracketsFix(variable).asIntention();
      TokenSet brackets = TokenSet.create(JavaTokenType.LBRACKET, JavaTokenType.RBRACKET);
      TextRange range = StreamEx.of(variable.getChildren())
        .filter(t -> PsiUtil.isJavaToken(t, brackets))
        .map(PsiElement::getTextRangeInParent)
        .reduce(TextRange::union)
        .orElseThrow()
        .shiftRight(variable.getTextRange().getStartOffset());// Must have at least one
      return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(range).descriptionAndTooltip(
        JavaAnalysisBundle.message("error.unnamed.variable.brackets")).registerFix(fix, null, null, null, null);
    }
    if (variable instanceof PsiPatternVariable) return null;
    if (variable instanceof PsiResourceVariable) return null;
    String message;
    IntentionAction fix = null;
    if (variable instanceof PsiLocalVariable local) {
      if (local.getInitializer() != null) return null;
      message = JavaAnalysisBundle.message("error.unnamed.variable.without.initializer");
      fix = getFixFactory().createAddVariableInitializerFix(local);
    }
    else if (variable instanceof PsiParameter parameter) {
      PsiElement scope = parameter.getDeclarationScope();
      if (!(scope instanceof PsiMethod)) return null;
      message = JavaAnalysisBundle.message("error.unnamed.method.parameter.not.allowed");
    }
    else if (variable instanceof PsiField) {
      message = JavaAnalysisBundle.message("error.unnamed.field.not.allowed");
    }
    else {
      message = JavaAnalysisBundle.message("error.unnamed.variable.not.allowed.in.this.context");
    }
    TextRange range = TextRange.create(variable.getTextRange().getStartOffset(),
                                       Objects.requireNonNull(variable.getNameIdentifier()).getTextRange().getEndOffset());
    HighlightInfo.Builder builder = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(range).descriptionAndTooltip(message);
    if (fix != null) {
      builder.registerFix(fix, null, null, null, null);
    }
    return builder;
  }
static HighlightInfo.Builder checkUnnamedVariableDeclaration(@NotNull PsiVariable variable)