### Question:
WebSocketServerProtocolHandler extends WebSocketProtocolHandler { static WebSocketServerHandshaker getHandshaker(ChannelHandlerContext ctx) { return ctx.attr(HANDSHAKER_ATTR_KEY).get(); } WebSocketServerProtocolHandler(String websocketPath);  WebSocketServerProtocolHandler(String websocketPath, String subprotocols);  WebSocketServerProtocolHandler(String websocketPath, String subprotocols, boolean allowExtensions); @Override void handlerAdded(ChannelHandlerContext ctx); @Override void exceptionCaught(ChannelHandlerContext ctx, Throwable cause);  }### Answer:
@Test public void testHttpUpgradeRequest() throws Exception { EmbeddedChannel ch = createChannel(new MockOutboundHandler()); ChannelHandlerContext handshakerCtx = ch.pipeline().context(WebSocketServerProtocolHandshakeHandler.class); writeUpgradeRequest(ch); assertEquals(SWITCHING_PROTOCOLS, ReferenceCountUtil.releaseLater(responses.remove()).getStatus()); assertNotNull(WebSocketServerProtocolHandler.getHandshaker(handshakerCtx)); }