buf.clear();
buf.mark();
buf.position(buf.limit());
// duplicate's contents should be the same as buf
DoubleBuffer 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);
// duplicate's position, mark, and limit should be independent to buf
duplicate.reset();
assertEquals(duplicate.position(), 0);
duplicate.clear();
assertEquals(buf.position(), buf.limit());
buf.reset();
assertEquals(buf.position(), 0);
// duplicate share the same content with buf
// FIXME
if (!duplicate.isReadOnly()) {
loadTestData1(buf);
assertContentEquals(buf, duplicate);
loadTestData2(duplicate);
assertContentEquals(buf, duplicate);
}