private MetricAggregatingRequestLog.StatisticsEntry waitForStatistics(MetricAggregatingRequestLog statisticsCollector) {
        List<MetricAggregatingRequestLog.StatisticsEntry> entries = List.of();
        int tries = 0;
        // Wait up to 30 seconds before giving up
        while (entries.isEmpty() && tries < 300) {
            entries = statisticsCollector.takeStatistics();
            if (entries.isEmpty())
                try {Thread.sleep(100); } catch (InterruptedException e) {}
            tries++;
        }
        assertEquals(1, entries.size());
        return entries.get(0);
    }
@author Oyvind Bakksjo
@author Simon Thoresen Hult
@author bjorncs
container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java