buf.position(buf.limit());
// duplicate's contents should be the same as buf
ShortBuffer duplicate = buf.duplicate();
assertNotSame(buf, duplicate);
assertEquals(buf.position(), duplicate.position());
assertEquals(buf.limit(), duplicate.limit());
assertEquals(buf.isReadOnly(), duplicate.isReadOnly());
assertEquals(buf.isDirect(), duplicate.isDirect());
assertEquals(buf.order(), duplicate.order());
assertContentEquals(buf, duplicate);