@Test
    void testMultiSearchAndPing() {
        TimeTracker t = new TimeTracker(null);
        t.injectTimeSource(new CreativeTimeSource(new long[]{1L, 4L, 16L, 32L, 64L, 128L, 256L}));
        Query q = new Query();
        Result r = new Result(q);
        t.sampleSearch(0, false);
        t.samplePing(0, false);
        t.sampleSearch(0, false);
        t.samplePing(0, false);
        t.sampleSearch(0, false);
        t.sampleFill(0, false);
        t.sampleSearchReturn(0, false, r);
        assertEquals(1L, t.first());
        assertEquals(256L, t.last());
        assertEquals(128L, t.firstFill());
        assertEquals(83L, t.searchTime());
        assertEquals(128L, t.fillTime());
        assertEquals(44L, t.pingTime());
        assertEquals(255L, t.totalTime());
        ElapsedTime e = new ElapsedTime();
        e.add(t);
        e.add(t);
        // multiple adds is supposed to be safe
        assertEquals(255L, t.totalTime());
        TimeTracker tx = new TimeTracker(null);
        tx.injectTimeSource(new CreativeTimeSource(new long[]{1L, 2L, 3L, 4L}));
        Query qx = new Query();
        Result rx = new Result(qx);
        tx.sampleSearch(0, false);
        tx.sampleFill(0, false);
        tx.samplePing(0, false);
        tx.sampleSearchReturn(0, false, rx);
        e.add(tx);
        assertEquals(258L, e.totalTime());
        assertEquals(129L, e.fillTime());
        assertEquals(2L, e.firstFill());
    }
Check sanity of TimeTracker and ElapsedTime.

@author Steinar Knutsen
container-search/src/test/java/com/yahoo/search/statistics/ElapsedTimeTestCase.java