private void assertTraceWithChildExecutionMessages(Query query) {
        Iterator<String> trace = collectTrace(query).iterator();
        assertEquals("(level start)", trace.next());
        assertEquals("  No query profile is used", trace.next());
        assertEquals("  Before execution", trace.next());
        assertEquals("  (level start)", trace.next());
        assertEquals("    During forker: 0", trace.next());
        assertEquals("    (level start)", trace.next());
        assertEquals("      During branch 1: 0", trace.next());
        assertEquals("    (level end)", trace.next());
        assertEquals("    (level start)", trace.next());
        assertEquals("      During branch 2: 0", trace.next());
        assertEquals("    (level end)", trace.next());
        assertEquals("  (level end)", trace.next());
        assertEquals("(level end)", trace.next());
        assertFalse(trace.hasNext());
    }
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