private static Solution AnnotateSolution(string originalCode, InvocationExpressionFinder[] invocationExpressionFinders, CustomWorkspace workspace, out Document annotatedDocument)
        {
            DocumentId documentId;
            var originalSolution = CreateOriginalDocument(originalCode, workspace, out documentId);
            var originalDocument = originalSolution.GetDocument(documentId);

            annotatedDocument = AnnotateDocument(originalDocument, invocationExpressionFinders);

            return originalSolution.WithDocumentSyntaxRoot(documentId, originalDocument.GetSyntaxRootAsync().Result);
        }
        private static Document AnnotateInvocation(Document document, InvocationExpressionFinder invocationExpressionFinder, int index)
        {
            var originalSyntaxTree = (SyntaxTree)document.GetSyntaxTreeAsync().Result;
            var originalApmInvocation = invocationExpressionFinder(originalSyntaxTree);

            var annotatedApmInvocation = originalApmInvocation
                .WithAdditionalAnnotations(
                    new RefactorableAPMInstance(index)
                );

            var annotatedSyntax = ((CompilationUnitSyntax)originalSyntaxTree.GetRoot())
                .ReplaceNode(
                    originalApmInvocation,
                    annotatedApmInvocation
                );

            Logger.Trace("Invocation tagged for refactoring: {0}", annotatedApmInvocation);

            return document.WithSyntaxRoot(annotatedSyntax);
        }