@Override
    public void write(ApiMessageAndVersion record) {
        if (closed) throw new ImageWriterClosedException();
        records.add(record);
    }
@Test
    public void testWrite() {
        RecordListWriter writer = new RecordListWriter();
        writer.write(testRecord(0));
        writer.write(testRecord(1));
        writer.close(true);
        assertEquals(Arrays.asList(testRecord(0), testRecord(1)), writer.records());
    }