### Question:
SpanningRecordSerializer implements RecordSerializer<T> { @Override public boolean hasSerializedData() { return lengthBuffer.hasRemaining() || dataBuffer.hasRemaining(); } SpanningRecordSerializer(); @Override SerializationResult addRecord(T record); @Override SerializationResult continueWritingWithNextBufferBuilder(BufferBuilder buffer); @Override void clear(); @Override boolean hasSerializedData();  }### Answer:
@Test public void testHasSerializedData() throws IOException { final int segmentSize = 16; final SpanningRecordSerializer<SerializationTestType> serializer = new SpanningRecordSerializer<>(); final SerializationTestType randomIntRecord = Util.randomRecord(SerializationTestTypeFactory.INT); Assert.assertFalse(serializer.hasSerializedData()); serializer.addRecord(randomIntRecord); Assert.assertTrue(serializer.hasSerializedData()); serializer.continueWritingWithNextBufferBuilder(createBufferBuilder(segmentSize)); Assert.assertFalse(serializer.hasSerializedData()); serializer.continueWritingWithNextBufferBuilder(createBufferBuilder(8)); serializer.addRecord(randomIntRecord); Assert.assertFalse(serializer.hasSerializedData()); serializer.addRecord(randomIntRecord); Assert.assertTrue(serializer.hasSerializedData()); }