assertEquals(b.length, buffer.position());
buffer.flip();
assertEquals(0, buffer.position());
assertEquals(b.length, buffer.limit());
assertEquals(b.length, buffer.capacity());
assertEquals(b.length, buffer.remaining());
assertTrue(buffer.hasRemaining());
assertEquals(buffer.asByteBuffer(), ByteBuffer.wrap(b));
random.nextBytes(b);
buffer.put(ByteBuffer.wrap(b));