private ChannelHandlerContext mockChannelHandlerContext(
final AlternativeCompositeByteBuf buf, final AtomicReference<Message> m2) {
ChannelHandlerContext ctx = mock(ChannelHandlerContext.class);
ByteBufAllocator alloc = mock(ByteBufAllocator.class);
when(ctx.alloc()).thenReturn(alloc);
when(alloc.ioBuffer()).thenReturn(buf);
DatagramChannel dc = mock(DatagramChannel.class);
when(ctx.channel()).thenReturn(dc);
when(ctx.writeAndFlush(any(), any(ChannelPromise.class))).thenReturn(
null);