@Override
            public void onMetadataUpdate(MetadataDelta delta, MetadataImage newImage, LoaderManifest manifest) {
                capturedImages.add(newImage);
                if (!firstPublish.isDone()) {
                    firstPublish.complete(null);
                }
            }
Test that loading a snapshot clears the previous state.
metadata/src/test/java/org/apache/kafka/image/loader/MetadataLoaderTest.java