ClusterStateBundle { @Override public String toString() { if (derivedBucketSpaceStates.isEmpty()) { return String.format("ClusterStateBundle('%s'%s)", baselineState, deferredActivation ? " (deferred activation)" : ""); } Map<String, AnnotatedClusterState> orderedStates = new TreeMap<>(derivedBucketSpaceStates); return String.format("ClusterStateBundle('%s', %s%s)", baselineState, orderedStates.entrySet().stream() .map(e -> String.format("%s '%s'", e.getKey(), e.getValue())) .collect(Collectors.joining(", ")), deferredActivation ? " (deferred activation)" : ""); } private  ClusterStateBundle(AnnotatedClusterState baselineState, Map<String, AnnotatedClusterState> derivedBucketSpaceStates); private  ClusterStateBundle(AnnotatedClusterState baselineState, Map<String,
                               AnnotatedClusterState> derivedBucketSpaceStates,
                               boolean deferredActivation); static Builder builder(AnnotatedClusterState baselineState); static ClusterStateBundle of(AnnotatedClusterState baselineState, Map<String, AnnotatedClusterState> derivedBucketSpaceStates); static ClusterStateBundle of(AnnotatedClusterState baselineState,
                                        Map<String, AnnotatedClusterState> derivedBucketSpaceStates,
                                        boolean deferredActivation); static ClusterStateBundle ofBaselineOnly(AnnotatedClusterState baselineState, boolean deferredActivation); static ClusterStateBundle ofBaselineOnly(AnnotatedClusterState baselineState); static ClusterStateBundle empty(); AnnotatedClusterState getBaselineAnnotatedState(); ClusterState getBaselineClusterState(); Map<String, AnnotatedClusterState> getDerivedBucketSpaceStates(); boolean deferredActivation(); ClusterStateBundle cloneWithMapper(Function<ClusterState, ClusterState> mapper); ClusterStateBundle clonedWithVersionSet(int version); boolean similarTo(ClusterStateBundle other); int getVersion(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void toString_includes_all_bucket_space_states() { ClusterStateBundle bundle = createTestBundle(); assertThat(bundle.toString(), equalTo("ClusterStateBundle('distributor:2 storage:2', " + "default 'distributor:2 storage:2 .0.s:d', " + "global 'distributor:2 storage:2', " + "narnia 'distributor:2 .0.s:d storage:2')")); }