public void waitForAll(int queryTimeout, Clock clock) {
        long startTime = clock.millis();
        while ( ! targetsToWaitFor.isEmpty()) {
            TargetResult nextToWaitFor = targetWithSmallestTimeout(targetsToWaitFor, queryTimeout);
            long timeLeftOfNextTimeout = nextToWaitFor.timeout(queryTimeout) - ( clock.millis() - startTime );
            nextToWaitFor.getIfAvailable(timeLeftOfNextTimeout);
            targetsToWaitFor.remove(nextToWaitFor);
        }
    }
Wait on each target for that targets timeout.
In the worst case this is the same as waiting for the max target timeout,
in the average case it may be much better because lower timeout sources do not get to
drive the timeout above their own timeout value.
When this completes, results can be accessed from the TargetResults with no blocking
(i.e getOrTimeout) without breaking any contract.
container-search/src/main/java/com/yahoo/search/federation/FederationResult.java