@Override
    @Nonnull
    public <T> List<Future<T>> invokeAll(@Nonnull Collection<? extends Callable<T>> tasks) {
        throwRejectedExecutionExceptionIfShutdown();

        ArrayList<Future<T>> result = new ArrayList<>();

        for (Callable<T> task : tasks) {
            try {
                result.add(new CompletedFuture<>(task.call(), null));
            } catch (Exception e) {
                result.add(new CompletedFuture<>(null, e));
            }
        }
        return result;
    }
@Test
    void testInvokeAll() {
        final CompletableFuture<Thread> future = new CompletableFuture<>();
        testTaskSubmissionBeforeShutdown(
                testInstance -> testInstance.invokeAll(callableCollectionFromFuture(future)));

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