docs: private void validateProtocol(StatusLine statusLine, Map<String, List<String>> headers) throws WebSocketException
      {
          // Get the values of Sec-WebSocket-Protocol.
          List<String> values = headers.get("Sec-WebSocket-Protocol");
  
          if (values == null)
          {
              // Nothing to check.
              return;
          }
  
          // Protocol
          String protocol = values.get(0);
  
          if (protocol == null || protocol.length() == 0)
          {
              // Ignore.
              return;
          }
  
          // If the protocol is not contained in the original request
          // from this client.
          if (mWebSocket.getHandshakeBuilder().containsProtocol(protocol) == false)
          {
              // The protocol contained in the Sec-WebSocket-Protocol header is not supported.
              throw new OpeningHandshakeException(
                  WebSocketError.UNSUPPORTED_PROTOCOL,
                  "The protocol contained in the Sec-WebSocket-Protocol header is not supported: " + protocol,
                  statusLine, headers);
          }
  
          // Agreed protocol.
          mWebSocket.setAgreedProtocol(protocol);
      }