### Question:
SpanningRecordSerializer implements RecordSerializer<T> { @Override public boolean hasSerializedData() { return lengthBuffer.hasRemaining() || dataBuffer.hasRemaining(); } SpanningRecordSerializer(); @Override void serializeRecord(T record); @Override SerializationResult copyToBufferBuilder(BufferBuilder targetBuffer); @Override void reset(); @Override void prune(); @Override boolean hasSerializedData();  }### Answer:
@Test public void testHasSerializedData() throws IOException { final SpanningRecordSerializer<SerializationTestType> serializer = new SpanningRecordSerializer<>(); final SerializationTestType randomIntRecord = Util.randomRecord(SerializationTestTypeFactory.INT); Assert.assertFalse(serializer.hasSerializedData()); serializer.serializeRecord(randomIntRecord); Assert.assertTrue(serializer.hasSerializedData()); final BufferBuilder bufferBuilder1 = createBufferBuilder(16); serializer.copyToBufferBuilder(bufferBuilder1); Assert.assertFalse(serializer.hasSerializedData()); final BufferBuilder bufferBuilder2 = createBufferBuilder(8); serializer.reset(); serializer.copyToBufferBuilder(bufferBuilder2); Assert.assertFalse(serializer.hasSerializedData()); serializer.reset(); serializer.copyToBufferBuilder(bufferBuilder2); Assert.assertTrue(serializer.hasSerializedData()); }