@VisibleForTesting
  static Map<String, List<String>> getCombinedHeaders(final Map<String, List<String>> upgradeRequestHeaders, final Map<String, String> requestMessageHeaders) {
    final Map<String, List<String>> combinedHeaders = new HashMap<>();

    upgradeRequestHeaders.entrySet().stream()
        .filter(entry -> shouldIncludeUpgradeRequestHeader(entry.getKey()))
        .forEach(entry -> combinedHeaders.put(entry.getKey(), entry.getValue()));

    requestMessageHeaders.entrySet().stream()
        .filter(entry -> shouldIncludeRequestMessageHeader(entry.getKey()))
        .forEach(entry -> combinedHeaders.put(entry.getKey(), List.of(entry.getValue())));

    return combinedHeaders;
  }
@Test
  void testGetCombinedHeaders() {
    final Map<String, List<String>> upgradeRequestHeaders = Map.of(
        "Host", List.of("server.example.com"),
        "Upgrade", List.of("websocket"),
        "Connection", List.of("Upgrade"),
        "Sec-WebSocket-Key", List.of("dGhlIHNhbXBsZSBub25jZQ=="),
        "Sec-WebSocket-Protocol", List.of("chat, superchat"),
        "Sec-WebSocket-Version", List.of("13"),
        HttpHeaders.X_FORWARDED_FOR, List.of("127.0.0.1"),
        HttpHeaders.USER_AGENT, List.of("Upgrade request user agent"));

    final Map<String, String> requestMessageHeaders = Map.of(
        HttpHeaders.X_FORWARDED_FOR, "192.168.0.1",
        HttpHeaders.USER_AGENT, "Request message user agent");

    final Map<String, List<String>> expectedHeaders = Map.of(
        "Host", List.of("server.example.com"),
        HttpHeaders.X_FORWARDED_FOR, List.of("127.0.0.1"),
        HttpHeaders.USER_AGENT, List.of("Request message user agent"));

    assertThat(WebSocketResourceProvider.getCombinedHeaders(upgradeRequestHeaders, requestMessageHeaders)).isEqualTo(
        expectedHeaders);
  }