@Override public T apply(final CompletionService<T> completionService) { try { final Future<T> future = completionService.poll(timeout.getTime(), timeout.getUnit()); if (future == null) { cancelRemaining(); throw timeout.getTimeoutException(); } futures.remove(future); return future.get(); } catch (final InterruptedException e) { throw new RuntimeInterruptedException(e); } catch (final ExecutionException e) { throw new RuntimeExecutionException(e); } }