@Override
    @Nonnull
    public <T> Future<T> submit(@Nonnull Callable<T> task) {
        throwRejectedExecutionExceptionIfShutdown();

        try {
            T result = task.call();

            return new CompletedFuture<>(result, null);
        } catch (Exception e) {
            return new CompletedFuture<>(null, e);
        }
    }
@Test
    void testSubmitCallable() {
        final CompletableFuture<Thread> future = new CompletableFuture<>();
        testTaskSubmissionBeforeShutdown(
                testInstance -> testInstance.submit(callableFromFuture(future)));

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