docs: private void validateAccept(StatusLine statusLine, Map<String, List<String>> headers, String key) throws WebSocketException
      {
          // Get the values of Sec-WebSocket-Accept.
          List<String> values = headers.get("Sec-WebSocket-Accept");
  
          if (values == null)
          {
              // The opening handshake response does not contain 'Sec-WebSocket-Accept' header.
              throw new OpeningHandshakeException(
                  WebSocketError.NO_SEC_WEBSOCKET_ACCEPT_HEADER,
                  "The opening handshake response does not contain 'Sec-WebSocket-Accept' header.",
                  statusLine, headers);
          }
  
          // The actual value of Sec-WebSocket-Accept.
          String actual = values.get(0);
  
          // Concatenate.
          String input = key + ACCEPT_MAGIC;
  
          // Expected value of Sec-WebSocket-Accept
          String expected;
  
          try
          {
              // Message digest for SHA-1.
              MessageDigest md = MessageDigest.getInstance("SHA-1");
  
              // Compute the digest value.
              byte[] digest = md.digest(Misc.getBytesUTF8(input));
  
              // Base64.
              expected = Base64.encode(digest);
          }
          catch (Exception e)
          {
              // This never happens.
              return;
          }
  
          if (expected.equals(actual) == false)
          {
              // The value of 'Sec-WebSocket-Accept' header is different from the expected one.
              throw new OpeningHandshakeException(
                  WebSocketError.UNEXPECTED_SEC_WEBSOCKET_ACCEPT_HEADER,
                  "The value of 'Sec-WebSocket-Accept' header is different from the expected one.",
                  statusLine, headers);
          }
  
          // OK. The value of Sec-WebSocket-Accept is the same as the expected one.
      }