@Test
public void testHasData() {

	final int SEGMENT_SIZE = 16;
	final SpanningRecordSerializer<SerializationTestType> serializer = new SpanningRecordSerializer<SerializationTestType>();
	final Buffer buffer = new Buffer(new MemorySegment(new byte[SEGMENT_SIZE]), SEGMENT_SIZE, null);
	final SerializationTestType randomIntRecord = Util.randomRecord(SerializationTestTypeFactory.INT);
	Assert.assertFalse(serializer.hasData());
	try {
		serializer.addRecord(randomIntRecord);
		Assert.assertTrue(serializer.hasData());
		serializer.setNextBuffer(buffer);
		Assert.assertTrue(serializer.hasData());
		serializer.clear();
		Assert.assertFalse(serializer.hasData());
		serializer.setNextBuffer(buffer);
		serializer.addRecord(randomIntRecord);
		Assert.assertTrue(serializer.hasData());
		serializer.addRecord(randomIntRecord);
		Assert.assertTrue(serializer.hasData());
	} catch (IOException e) {
		e.printStackTrace();
	}
}