private void verifyMetadataForTopology(final String topologyName,
                                           final Collection<StreamsMetadata> left,
                                           final Collection<StreamsMetadata> right) {
        assertThat(left.size(), equalTo(right.size()));
        final Iterator<StreamsMetadata> leftIter = left.iterator();
        final Iterator<StreamsMetadata> rightIter = right.iterator();

        while (leftIter.hasNext()) {
            final StreamsMetadataImpl leftMetadata = (StreamsMetadataImpl) leftIter.next();
            final StreamsMetadataImpl rightMetadata = (StreamsMetadataImpl) rightIter.next();

            verifyPartitionsAndStoresForTopology(topologyName, leftMetadata);
            verifyPartitionsAndStoresForTopology(topologyName, rightMetadata);

            assertThat(verifyEquivalentMetadataForHost(leftMetadata, rightMetadata), is(true));
        }
    }
Validates that each metadata object has only partitions & state stores for its specific topology name and
asserts that {@code left} and {@code right} differ only by {@link StreamsMetadata#hostInfo()}
streams/src/test/java/org/apache/kafka/streams/integration/NamedTopologyIntegrationTest.java