@Test
public void testHasArray() {

    ByteBuf buf1 = Unpooled.wrappedBuffer("hello1".getBytes());
    DynamicCompositeByteBuf compositeByteBuf = new DynamicCompositeByteBuf(buf1);
    Assert.assertTrue(compositeByteBuf.hasArray() == true);
    ByteBuf buf2 = Unpooled.wrappedBuffer(buf1);
    compositeByteBuf.addBuffer(buf2);
    Assert.assertTrue(compositeByteBuf.hasArray() == false);
}