Add unit test for RecordWriter.