private List<String> collectTrace(Query query) {
        TraceCollector collector = new TraceCollector();
        query.getContext(false).getTrace().accept(collector);
        return collector.trace();
    }
Tests tracing scenarios where traces from multiple executions over the same query are involved.

@author bratseth
container-search/src/test/java/com/yahoo/search/searchchain/test/TraceTestCase.java