public static <IN, OUT> CompletableFuture<OUT> thenApplyAsyncIfNotDone(
            CompletableFuture<IN> completableFuture,
            Executor executor,
            Function<? super IN, ? extends OUT> applyFun) {
        return completableFuture.isDone()
                ? completableFuture.thenApply(applyFun)
                : completableFuture.thenApplyAsync(applyFun, executor);
    }
@Test
    void testApplyAsyncIfNotDone() {
        testFutureContinuation(
                (CompletableFuture<?> future, Executor executor) ->
                        FutureUtils.thenApplyAsyncIfNotDone(future, executor, o -> null));
    }