@Override
    public void write(ApiMessageAndVersion record) {
        if (closed) throw new ImageWriterClosedException();
        delta.replay(record.message());
    }
@Test
    public void testWrite() {
        MetadataDelta delta = new MetadataDelta.Builder().build();
        ImageReWriter writer = new ImageReWriter(delta);
        writer.write(testRecord(0));
        writer.write(testRecord(1));
        writer.close(true);
        assertEquals(2, delta.getOrCreateTopicsDelta().changedTopics().size());
        assertEquals(2, writer.image().topics().topicsById().size());
    }