ExecutionException, TimeoutException {
ExecutorService service = delegate.get();
if (service != null) {
// since the tasks are either executed or cancelled, there is no
// need to track them
return service.invokeAny(tasks, timeout, unit);
}
throw new RejectedExecutionException(
"Execution service is terminated. No more tasks can be executed.");
}