final FullHttpResponse response = handshaker.newHandshakeResponse(wsUpgradeRequest(), null);
assertThat(response.getStatus(), is(HttpResponseStatus.SWITCHING_PROTOCOLS));
assertThat(response.headers().get(CONNECTION), equalTo("Upgrade"));
assertThat(response.headers().get(UPGRADE), equalTo("WebSocket"));
assertThat(response.headers().get(SEC_WEBSOCKET_LOCATION), equalTo("ws://localhost/websocket"));
assertThat(response.headers().get(SEC_WEBSOCKET_ORIGIN), equalTo("http://example.com"));
assertThat(response.headers().get(CONTENT_LENGTH), is(nullValue()));
final ByteBuf content = Unpooled.copiedBuffer("^n:ds[4U", CharsetUtil.US_ASCII);
final ByteBuf key = handshaker.calculateLastKey(content);
assertThat(key.toString(CharsetUtil.US_ASCII), equalTo("8jKS'y:G*Co,Wxa-"));