Added MockRecordWriter for testing