private static async Task <Document> ReplaceIfElseWithYieldReturnStatementAsync(
            Document document,
            IfStatementSyntax ifStatement,
            ExpressionSyntax whenTrue,
            ExpressionSyntax whenFalse,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            SyntaxNode root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);

            YieldStatementSyntax newNode = YieldReturnStatement(
                CreateConditionalExpression(ifStatement, whenTrue, whenFalse));

            newNode = newNode
                      .WithTriviaFrom(ifStatement)
                      .WithFormatterAnnotation();

            SyntaxNode newRoot = root.ReplaceNode(ifStatement, newNode);

            return(document.WithSyntaxRoot(newRoot));
        }