static <T> CompletableFuture<T> toCompletableFuture(scala.concurrent.Future<T> scalaFuture,
                                                            ExecutorService executor) {
            final CompletableFuture<T> completableFuture = new CompletableFuture<>();

            scalaFuture.onComplete(value -> {
                if (value.isSuccess()) {
                    completableFuture.complete(value.get());
                } else {
                    final Failure<T> failure = (Failure<T>) value;
                    completableFuture.completeExceptionally(failure.exception());
                }
                return null;
            }, ExecutionContext.fromExecutorService(executor));

            return completableFuture;
        }
A converter that converts {@link scala.concurrent.Future} to {@link CompletableFuture}.
This nested class is lazily initialized only when scala-library is in the classpath.
core/src/main/java/com/linecorp/armeria/internal/server/annotation/ScalaUtil.java