    @Test
    public void testProcessBinaryMessage() throws URISyntaxException {


        Mockery context = new Mockery();
        final WebSocketHandler nextHandler = context.mock(WebSocketHandler.class);
        final WebSocketHandlerListener listener = context.mock(WebSocketHandlerListener.class);

        final WrappedByteBuffer message = new WrappedByteBuffer("test message".getBytes());
        context.checking(new Expectations() {
            {
                oneOf(nextHandler).setListener(with(aNonNull(WebSocketHandlerListener.class)));
                will(saveParameter("listener", 0));
                oneOf(nextHandler).processBinaryMessage(with(aNonNull(WebSocketChannel.class)), with(message));
                will(new CustomAction("will fire text message received") {

                    @Override
                    public Object invoke(Invocation invocation) {
                        WebSocketHandlerListener listener = (WebSocketHandlerListener)lookup("listener");
                        WebSocketChannel channel = (WebSocketChannel)invocation.getParameter(0);
                        listener.binaryMessageReceived(channel, message);
                        return null;
                    }
                });
                oneOf(listener).binaryMessageReceived(with(aNonNull(WebSocketChannel.class)), with(message));
            }
        });

        WSURI uri = new WSURI("ws://locationhost:8001/echo");
        WebSocketChannel channel = getNativeChannel(uri);

        WebSocketNativeBalancingHandler handler = new WebSocketNativeBalancingHandler();
        handler.setNextHandler(nextHandler);
        handler.setListener(listener);
        handler.processBinaryMessage(channel, message);
        context.assertIsSatisfied();
    }