private static @NotNull @NlsSafe String getTypePresentation(@NotNull PsiElement element) {
    PsiType type = null;
    PsiLocalVariable psiVariable = getPossibleLocaleVariable(element);
    if (psiVariable != null) {
      type = psiVariable.getType();
    }
    if (element instanceof PsiParameter parameter) {
      type = parameter.getType();
    }
    else if (element instanceof PsiExpression psiExpression) {
      type = psiExpression.getType();
    }
    if (type instanceof PsiLambdaExpressionType) {
      type = ((PsiLambdaExpressionType)type).getExpression().getFunctionalInterfaceType();
    }
    else if (type instanceof PsiMethodReferenceType) {
      type = ((PsiMethodReferenceType)type).getExpression().getFunctionalInterfaceType();
    }
    return type == null ? "<unknown>" : type.getPresentableText();
  }
private static @NotNull @NlsSafe String getTypePresentation(@NotNull PsiElement element)