private void assertTracing(boolean carryOverContext, boolean parallel) {
        Query query = new Query("?tracelevel=1");
        assertEquals(1, query.getTrace().getLevel());
        query.trace("Before execution", 1);
        Chain<Searcher> forkingChain = new Chain<>(new Tracer("forker"), 
                                                   new Forker(carryOverContext, parallel, 
                                                              new Tracer("branch 1") ,
                                                              new Tracer("branch 2")));
        new Execution(forkingChain, Execution.Context.createContextStub()).search(query);

        if (carryOverContext)
            assertTraceWithChildExecutionMessages(query);
        else if (parallel)
            assertTrace(query);
        else
            assertIncorrectlyNestedTrace(query);

        assertCorrectRendering(query);
    }
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