@Test
public void asReadOnly() {

    ByteBuf buf = buffer(1);
    ByteBuf readOnly = buf.asReadOnly();
    assertTrue(readOnly.isReadOnly());
    assertSame(readOnly, readOnly.asReadOnly());
    readOnly.release();
}