@Test
    void shouldCreateConnectionWhenExceedsMaxConcurrentStreams() throws Exception {
        final WebClient client = WebClient.builder(server.uri(SessionProtocol.H2C))
                                          .factory(clientFactory)
                                          .build();
        final AtomicInteger opens = new AtomicInteger();
        final AtomicInteger closes = new AtomicInteger();
        connectionPoolListener = newConnectionPoolListener(opens::incrementAndGet, closes::incrementAndGet);

        // Send (2 * MAX_CONCURRENT_STREAMS) requests to create 2 connections, never more and never less.
        final List<CompletableFuture<AggregatedHttpResponse>> receivedResponses = new ArrayList<>();
        final int NUM_CONNECTIONS = 2;
        for (int j = 0; j < NUM_CONNECTIONS; j++) {
            final int expectedOpens = j + 1;
            for (int i = 0; i < MAX_CONCURRENT_STREAMS; i++) {
                // Send a request.
                receivedResponses.add(client.get(PATH).aggregate());

                // Check the number of open and closed connections.
                await().untilAsserted(() -> {
                    assertThat(opens).hasValue(expectedOpens);
                    assertThat(closes).hasValue(0);
                });
            }
        }

        // Complete one request so that we have a connection with (MAX_CONCURRENT_STREAM - 1) active streams.
        responses.poll().complete(HttpResponse.of(200));
        await().until(() -> receivedResponses.stream().anyMatch(CompletableFuture::isDone));

        // Send a new request, which must not create a new connection but use an existing connection.
        client.get(PATH).aggregate();

        // Wait for a while to make sure no new connection is created.
        for (int i = 0; i < 3; i++) {
            Thread.sleep(1000);
            assertThat(opens).hasValue(NUM_CONNECTIONS);
            assertThat(closes).hasValue(0);
        }
    }
Makes sure Armeria HTTP client respects {@code MAX_CONCURRENT_STREAMS} HTTP/2 setting.
core/src/test/java/com/linecorp/armeria/client/HttpClientMaxConcurrentStreamTest.java