@Override
    @Nonnull
    public <T> T invokeAny(@Nonnull Collection<? extends Callable<T>> tasks)
            throws ExecutionException {
        throwRejectedExecutionExceptionIfShutdown();

        Exception exception = null;

        for (Callable<T> task : tasks) {
            try {
                return task.call();
            } catch (Exception e) {
                // try next task
                exception = e;
            }
        }

        throw new ExecutionException("No tasks finished successfully.", exception);
    }
@Test
    void testInvokeAnyWithNoopShutdown() {
        final CompletableFuture<Thread> future = new CompletableFuture<>();
        testWithNoopShutdown(
                testInstance -> testInstance.invokeAny(callableCollectionFromFuture(future)));

        assertThat(future).isCompletedWithValue(Thread.currentThread());
    }