boolean (@NotNull PsiLambdaExpression lambda, @NotNull Supplier<? extends PsiExpression> newFunctionSupplier) { return isSafeLambdaReplacement(lambda, l -> { PsiExpression replacement = newFunctionSupplier.get(); return replacement == null ? null : (PsiExpression)l.replace(replacement); }); }