@Override
    public boolean isFrozen() {
        return writer.isFrozen();
    }
@Test
    void testFailingFreeze() {
        NoopRawSnapshotWriter rawWriter = new NoopRawSnapshotWriter() {
            @Override
            public void freeze() {
                throw new IllegalStateException();
            }
        };

        AtomicBoolean called = new AtomicBoolean(false);
        Consumer<OffsetAndEpoch> consumer = ignored -> called.set(true);

        try (RawSnapshotWriter writer = new NotifyingRawSnapshotWriter(rawWriter, consumer)) {
            assertThrows(IllegalStateException.class, writer::freeze);
        }

        assertFalse(called.get());
        assertFalse(rawWriter.isFrozen());
        assertTrue(rawWriter.closed);
    }