@Test
    void shouldNotDelegateIfCompletedAlready() {
        final HttpResponse originalRes = HttpResponse.of(200);

        // Because we don't expect users to always use `UnmodifiableFuture`.
        @SuppressWarnings("checkstyle:PreferUnmodifiableFuture")
        final CompletableFuture<HttpResponse> completedFuture = CompletableFuture.completedFuture(originalRes);

        final HttpResponse res1 = HttpResponse.of(completedFuture);
        final HttpResponse res2 = HttpResponse.of((CompletionStage<? extends HttpResponse>) completedFuture);
        assertThat(res1).isSameAs(originalRes);
        // CompletionStage does not provide the current state.
        assertThat(res2).isNotSameAs(originalRes);
    }
When the given future is already complete, we should not wrap it with {@link DeferredHttpResponse}
but just return the response directly.
core/src/test/java/com/linecorp/armeria/common/DeferredHttpResponseTest.java