docs: private void validateConnection(StatusLine statusLine, Map<String, List<String>> headers) throws WebSocketException
      {
          // Get the values of Upgrade.
          List<String> values = headers.get("Connection");
  
          if (values == null || values.size() == 0)
          {
              // The opening handshake response does not contain 'Connection' header.
              throw new OpeningHandshakeException(
                  WebSocketError.NO_CONNECTION_HEADER,
                  "The opening handshake response does not contain 'Connection' header.",
                  statusLine, headers);
          }
  
          for (String value : values)
          {
              // Split the value of Connection header into elements.
              String[] elements = value.split("\\s*,\\s*");
  
              for (String element : elements)
              {
                  if ("Upgrade".equalsIgnoreCase(element))
                  {
                      // Found 'Upgrade' in Connection header.
                      return;
                  }
              }
          }
  
          // 'Upgrade' was not found in 'Connection' header.
          throw new OpeningHandshakeException(
              WebSocketError.NO_UPGRADE_IN_CONNECTION_HEADER,
              "'Upgrade' was not found in 'Connection' header.",
              statusLine, headers);
      }