bson/src/main/org/bson/codecs/configuration/CodecRegistries.java
public static CodecRegistry fromRegistries(final List<? extends CodecRegistry> registries) {
        List<CodecProvider> providers = new ArrayList<CodecProvider>();
        for (CodecRegistry registry : registries) {
            providers.add(providerFromRegistry(registry));
        }
        return new ProvidersCodecRegistry(providers);
    }
public static CodecRegistry fromRegistries(final List<? extends CodecRegistry> registries) {
        List<CodecProvider> providers = new ArrayList<CodecProvider>();
        for (CodecRegistry registry : registries) {
            providers.add(providerFromRegistry(registry));
        }
        return new ProvidersCodecRegistry(providers);
    }
A {@code CodecRegistry} that combines the given {@code CodecRegistry} instances into a single registry.

<p>The registries are checked in order until one returns a {@code Codec} for the requested {@code Class}.</p>

<p>The created instance can handle cycles of {@code Codec} dependencies, i.e when the construction of a {@code Codec} for class A
requires the construction of a {@code Codec} for class B, and vice versa.</p>

<p>Any of the given registries that also implement {@code CodecProvider} will be treated as a {@code CodecProvider} instead of a
{@code CodecRegistry}, which will ensure proper resolution of any dependencies between registries.</p>

@param registries the preferred registry for {@code Codec} lookups

@return a {@code CodecRegistry} that combines the list of {@code CodecRegistry} instances into a single one