public static <U> UnmodifiableFuture<U> wrap(CompletableFuture<U> future) {
        requireNonNull(future, "future");
        final UnmodifiableFuture<U> unmodifiable = new UnmodifiableFuture<>();
        future.handle((result, cause) -> {
            if (cause != null) {
                unmodifiable.doCompleteExceptionally(Exceptions.peel(cause));
            } else {
                unmodifiable.doComplete(result);
            }
            return null;
        });
        return unmodifiable;
    }
Returns an {@link UnmodifiableFuture} which will be completed when the specified
{@link CompletableFuture} is completed.
core/src/main/java/com/linecorp/armeria/common/util/UnmodifiableFuture.java