static HighlightInfo.Builder checkVarTypeApplicability(@NotNull PsiTypeElement typeElement) {
    if (!typeElement.isInferredType()) {
      return null;
    }
    PsiElement parent = typeElement.getParent();
    PsiVariable variable = tryCast(parent, PsiVariable.class);
    if (variable instanceof PsiLocalVariable) {
      PsiExpression initializer = variable.getInitializer();
      if (initializer == null) {
        String message = JavaErrorBundle.message("lvti.no.initializer");
        HighlightInfo.Builder info =
          HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).descriptionAndTooltip(message).range(typeElement);
        HighlightFixUtil.registerSpecifyVarTypeFix((PsiLocalVariable)variable, info);
        return info;
      }
      if (initializer instanceof PsiFunctionalExpression) {
        boolean lambda = initializer instanceof PsiLambdaExpression;
        String message = JavaErrorBundle.message(lambda ? "lvti.lambda" : "lvti.method.ref");
        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).descriptionAndTooltip(message).range(typeElement);
      }

      if (isArrayDeclaration(variable)) {
        String message = JavaErrorBundle.message("lvti.array");
        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).descriptionAndTooltip(message).range(typeElement);
      }

      PsiType lType = variable.getType();
      if (PsiTypes.nullType().equals(lType) && 
          ExpressionUtils.nonStructuralChildren(initializer).allMatch(ExpressionUtils::isNullLiteral)) {
        HighlightInfo.Builder info =
          HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).descriptionAndTooltip(JavaErrorBundle.message("lvti.null"))
            .range(typeElement);
        HighlightFixUtil.registerSpecifyVarTypeFix((PsiLocalVariable)variable, info);
        return info;
      }
      if (PsiTypes.voidType().equals(lType)) {
        String message = JavaErrorBundle.message("lvti.void");
        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).descriptionAndTooltip(message).range(typeElement);
      }
    }
    else if (variable instanceof PsiParameter && variable.getParent() instanceof PsiParameterList && isArrayDeclaration(variable)) {
      String message = JavaErrorBundle.message("lvti.array");
      return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).descriptionAndTooltip(message).range(typeElement);
    }

    return null;
  }
static HighlightInfo.Builder checkVarTypeApplicability(@NotNull PsiTypeElement typeElement)