public static void writeAndFlushWithVoidPromise(ChannelOutboundInvoker ctx, ByteBuf msg) {
        ctx.writeAndFlush(msg, ctx.voidPromise());
    }
@Test
    public void testWriteAndFlushWithVoidPromise() {
        final ChannelOutboundInvoker ctx = mock(ChannelOutboundInvoker.class);
        final VoidChannelPromise voidChannelPromise = mock(VoidChannelPromise.class);
        when(ctx.voidPromise()).thenReturn(voidChannelPromise);
        final byte[] data = "test".getBytes(StandardCharsets.UTF_8);
        final ByteBuf byteBuf = Unpooled.wrappedBuffer(data, 0, data.length);
        try {
            NettyChannelUtil.writeAndFlushWithVoidPromise(ctx, byteBuf);
            verify(ctx).writeAndFlush(same(byteBuf), same(voidChannelPromise));
            verify(ctx).voidPromise();
        } finally {
            byteBuf.release();
        }
    }