@Test
public void testWrapMedium() {

    ByteBuf buffer = copyMedium(1, 4);
    assertEquals(6, buffer.capacity());
    assertEquals(1, buffer.readMedium());
    assertEquals(4, buffer.readMedium());
    assertFalse(buffer.isReadable());
    buffer.release();
    buffer = copyMedium(null);
    assertEquals(0, copyMedium(null).capacity());
    buffer.release();
    buffer = copyMedium(new int[] {});
    assertEquals(0, buffer.capacity());
    buffer.release();
}