ProblemType (@NotNull PsiReferenceExpression optionalRef, @Nullable PsiElement trueElement, @Nullable PsiElement falseElement) { if (!(trueElement instanceof PsiReturnStatement trueReturn) || !(falseElement instanceof PsiReturnStatement falseReturn)) return ProblemType.NONE; PsiExpression falseValue = falseReturn.getReturnValue(); PsiExpression trueValue = trueReturn.getReturnValue(); if (!isSimpleOrUnchecked(falseValue)) return ProblemType.NONE; return getTypeByLambdaCandidate(optionalRef, trueValue, falseValue); }