private void assertCorrectRendering(Query query) {
        try {
            StringWriter writer = new StringWriter();
            query.getContext(false).render(writer);
            String expected =
                    "<meta type=\"context\">\n" +
                    "\n" +
                    "  <p>No query profile is used</p>\n" +
                    "\n" +
                    "  <p>Before execution</p>\n" +
                    "\n" +
                    "  <p>\n" +
                    "    <p>During forker: 0";
            assertEquals(expected, writer.toString().substring(0, expected.length()));
        }
        catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
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