private S3StreamsMetadataImage createStreamImage() {
        DeltaList<S3StreamSetObject> broker0Objects = DeltaList.of(
            new S3StreamSetObject(0, BROKER0, List.of(new StreamOffsetRange(STREAM0, 10L, 20L)), 0L),
            new S3StreamSetObject(1, BROKER0, List.of(new StreamOffsetRange(STREAM0, 40L, 60L)), 1L));
        NodeS3StreamSetObjectMetadataImage broker0WALMetadataImage = new NodeS3StreamSetObjectMetadataImage(BROKER0, S3StreamConstant.INVALID_BROKER_EPOCH,
            broker0Objects);
        List<RangeMetadata> ranges = List.of(
            new RangeMetadata(STREAM0, 0L, 0, 10L, 40L, BROKER0),
            new RangeMetadata(STREAM0, 2L, 2, 40L, 60L, BROKER0));
        DeltaList<S3StreamObject> streamObjects = DeltaList.of(
            new S3StreamObject(8, STREAM0, 20L, 40L));
        S3StreamMetadataImage streamImage = new S3StreamMetadataImage(STREAM0, 4L, StreamState.OPENED, new S3StreamRecord.TagCollection(), 10, ranges, streamObjects);
        RegistryRef ref = new RegistryRef();
        TimelineHashMap<Long, S3StreamMetadataImage> streamMetadataMap = new TimelineHashMap<>(ref.registry(), 0);
        streamMetadataMap.put(STREAM0, streamImage);
        TimelineHashMap<Integer, NodeS3StreamSetObjectMetadataImage> nodeMetadataMap = new TimelineHashMap<>(ref.registry(), 0);
        nodeMetadataMap.put(BROKER0, broker0WALMetadataImage);
        ref = ref.next();
        return new S3StreamsMetadataImage(STREAM0, ref, streamMetadataMap,
            nodeMetadataMap, new TimelineHashMap<>(ref.registry(), 0), new TimelineHashMap<>(ref.registry(), 0), new TimelineHashMap<>(RegistryRef.NOOP.registry(), 0));
    }
Test get objects with the first hit object is a stream object.
metadata/src/test/java/org/apache/kafka/image/S3StreamsMetadataImageTest.java