@Test
    void testTracing() {
        Query q = new Query("?query=foo&type=all&traceLevel=2");
        assertEquals(2, q.getTrace().getLevel());
        q.trace(true, 1, "trace1");
        q.trace(false, 2, "trace2");
        q.trace(true, 3, "Ignored");
        q.trace(true, 2, "trace3-1", ", ", "trace3-2");
        q.trace(false, 1, "trace4-1", ", ", "trace4-2");
        q.trace(false, 3, "Ignored-1", "Ignored-2");
        Set<String> traces = new HashSet<>();
        for (String trace : q.getContext(true).getTrace().traceNode().descendants(String.class))
            traces.add(trace);
        assertTrue(traces.contains("trace1: [select * from sources * where default contains \"foo\"]"));
        assertTrue(traces.contains("trace2"));
        assertTrue(traces.contains("trace3-1, trace3-2: [select * from sources * where default contains \"foo\"]"));
        assertTrue(traces.contains("trace4-1, trace4-2"));
    }
Test that we get the last value if a parameter is assigned multiple times
container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java