public static ChannelFuture sendUnsupportedVersionResponse(Channel channel) {
        return sendUnsupportedVersionResponse(channel, channel.newPromise());
    }
@Test
    public void testUnsupportedVersion() throws Exception {
        EmbeddedChannel ch = new EmbeddedChannel();
        WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(ch);
        ch.runPendingTasks();
        Object msg = ch.readOutbound();

        if (!(msg instanceof FullHttpResponse)) {
            fail("Got wrong response " + msg);
        }
        FullHttpResponse response = (FullHttpResponse) msg;

        assertEquals(HttpResponseStatus.UPGRADE_REQUIRED, response.status());
        assertEquals(WebSocketVersion.V13.toHttpHeaderValue(),
                response.headers().get(HttpHeaderNames.SEC_WEBSOCKET_VERSION));
        assertTrue(HttpUtil.isContentLengthSet(response));
        assertEquals(0, HttpUtil.getContentLength(response));

        ReferenceCountUtil.release(response);
        assertFalse(ch.finish());
    }