public ClusterStateBundle cloneWithMapper(Function<ClusterState, ClusterState> mapper) {
        AnnotatedClusterState clonedBaseline = baselineState.cloneWithClusterState(
                mapper.apply(baselineState.getClusterState().clone()));
        Map<String, AnnotatedClusterState> clonedDerived = derivedBucketSpaceStates.entrySet().stream()
                .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().cloneWithClusterState(
                        mapper.apply(e.getValue().getClusterState().clone()))));
        return new ClusterStateBundle(clonedBaseline, clonedDerived, distributionConfig, feedBlock, deferredActivation);
    }
@Test
    void cloning_preserves_distribution_config() {
        var bundle = createTestBundleWithDistributionConfig(DistributionBuilder.configForFlatCluster(5));
        var derived = bundle.cloneWithMapper(Function.identity());
        assertEquals(bundle, derived);
    }