ClusterState contains Enrich Policy metadata information, that can be useful to other plugins.
As of now, ClusterState metadata contains [EnrichMetadata](https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichMetadata.java) objects, that contain [EnrichPolicy](https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichPolicy.java) objects.
While `EnrichPolicy` class is in `core`, `EnrichMetadata` is in `enrich` plugin, so it's practically impossible to access EnrichPolicy information without creating a dependency from `enrich` plugin.
It would be good to have an interface in core to avoid this dependency.
x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichMetadataTests.java
}
    @Override
    protected EnrichMetadata createXContextTestInstance(XContentType xContentType) {
        return randomEnrichMetadata(xContentType);
    }
    private static EnrichMetadata randomEnrichMetadata(XContentType xContentType) {
        int numPolicies = randomIntBetween(8, 64);
        Map<String, EnrichPolicy> policies = Maps.newMapWithExpectedSize(numPolicies);
        for (int i = 0; i < numPolicies; i++) {
            EnrichPolicy policy = randomEnrichPolicy(xContentType);
            policies.put(randomAlphaOfLength(8), policy);
        }
        return new EnrichMetadata(policies);
    }
    @Override
    protected Writeable.Reader<EnrichMetadata> instanceReader() {
        return EnrichMetadata::new;
    }
    @Override
    protected void assertEqualInstances(EnrichMetadata expectedInstance, EnrichMetadata newInstance) {
        assertNotSame(expectedInstance, newInstance);
        assertThat(newInstance.getPolicies().size(), equalTo(expectedInstance.getPolicies().size()));
        for (Map.Entry<String, EnrichPolicy> entry : newInstance.getPolicies().entrySet()) {
            EnrichPolicy actual = entry.getValue();
            EnrichPolicy expected = expectedInstance.getPolicies().get(entry.getKey());
            EnrichPolicyTests.assertEqualPolicies(expected, actual);
        }
    }
}