@Test
public void testRead() throws IOException {

    ByteBuf buf = Unpooled.buffer(12);
    buf.writeByte(1);
    buf.writeByte(2);
    DynamicCompositeByteBuf compositeByteBuf = new DynamicCompositeByteBuf(buf);
    DynamicCompositeByteBufInputStream inputStream = new DynamicCompositeByteBufInputStream(compositeByteBuf);
    Assert.assertTrue(inputStream != null);
    int b = inputStream.read();
    Assert.assertTrue(b == 1);
    Assert.assertTrue(buf.refCnt() == 1);
    inputStream.close();
    Assert.assertTrue(buf.refCnt() == 1);
    compositeByteBuf.release();
    Assert.assertTrue(buf.refCnt() == 0);
    inputStream.close();
}