@Test
public void testgetNioBufferThreadSafe() {

	final MemorySegment segment = MemorySegmentFactory.allocateUnpooledSegment(1024);
	final BufferRecycler recycler = Mockito.mock(BufferRecycler.class);
	Buffer buffer = new Buffer(segment, recycler);
	ByteBuffer buf1 = buffer.getNioBuffer();
	ByteBuffer buf2 = buffer.getNioBuffer();
	assertNotNull(buf1);
	assertNotNull(buf2);
	assertTrue("Repeated call to getNioBuffer() returns the same nio buffer", buf1 != buf2);
}