ProblemType (@NotNull PsiReferenceExpression optionalVariable, @Nullable PsiElement trueElement, @Nullable PsiElement falseElement) { if(!(trueElement instanceof PsiExpression trueExpression) || !(falseElement instanceof PsiExpression falseExpression)) return ProblemType.NONE; PsiType trueType = trueExpression.getType(); PsiType falseType = falseExpression.getType(); if (trueType == null || falseType == null || !trueType.isAssignableFrom(falseType) || !isSimpleOrUnchecked(falseExpression)) { return ProblemType.NONE; } return getTypeByLambdaCandidate(optionalVariable, trueExpression, falseExpression); }