ServiceContextAwareExecutorService implements ExecutorService { @Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException { return _delegateExecutor.invokeAll(wrapTasks(tasks)); } ServiceContextAwareExecutorService(ExecutorService delegate); @Override void shutdown(); @Override List<Runnable> shutdownNow(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override boolean awaitTermination(long timeout, TimeUnit unit); @Override Future<T> submit(Callable<T> task); @Override Future<T> submit(Runnable task, T result); @Override Future<?> submit(Runnable task); @Override List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks); @Override List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit); @Override T invokeAny(Collection<? extends Callable<T>> tasks); @Override T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit); @Override void execute(Runnable command);  }
@Test public void invokeAll() throws InterruptedException { List<Callable<Boolean>> tasks2 = Lists.newArrayList(callable(), callable()); List<Future<Boolean>> futures2 = _executor.invokeAll(tasks2); assertTrue(Iterables.all(futures2, predicate())); List<Callable<Boolean>> tasks1 = Lists.newArrayList(callable(), callable()); List<Future<Boolean>> futures1 = _underlying.invokeAll(tasks1); assertTrue(Iterables.all(futures1, Predicates.not(predicate()))); }