### Question:
ByteBufList extends AbstractReferenceCounted { @VisibleForTesting public static ByteBuf coalesce(ByteBufList list) { ByteBuf res = Unpooled.buffer(list.readableBytes()); for (int i = 0; i < list.buffers.size(); i++) { ByteBuf b = list.buffers.get(i); res.writeBytes(b, b.readerIndex(), b.readableBytes()); } return res; } private  ByteBufList(Handle<ByteBufList> recyclerHandle); static ByteBufList get(ByteBuf b1, ByteBuf b2); static ByteBufList get(ByteBuf b1); static ByteBufList clone(ByteBufList other); void add(ByteBuf buf); void prepend(ByteBuf buf); int readableBytes(); ByteBuf getBuffer(int index); int size(); int getBytes(byte[] dst); byte[] toArray(); boolean hasArray(); byte[] array(); int arrayOffset(); @VisibleForTesting static ByteBuf coalesce(ByteBufList list); @Override ByteBufList retain(); @Override ReferenceCounted touch(Object hint); static final Encoder ENCODER; static final Encoder ENCODER_WITH_SIZE; }### Answer:
@Test public void testCoalesce() throws Exception { ByteBufList buf = ByteBufList.get(Unpooled.wrappedBuffer("hello".getBytes()), Unpooled.wrappedBuffer("world".getBytes())); assertEquals(Unpooled.wrappedBuffer("helloworld".getBytes()), ByteBufList.coalesce(buf)); }