@Bean
    public BulkheadRegistry bulkheadRegistry(
        BulkheadConfigurationProperties bulkheadConfigurationProperties,
        EventConsumerRegistry<BulkheadEvent> bulkheadEventConsumerRegistry,
        RegistryEventConsumer<Bulkhead> bulkheadRegistryEventConsumer,
        @Qualifier("compositeBulkheadCustomizer") CompositeCustomizer<BulkheadConfigCustomizer> compositeBulkheadCustomizer) {
        BulkheadRegistry bulkheadRegistry = createBulkheadRegistry(bulkheadConfigurationProperties,
            bulkheadRegistryEventConsumer, compositeBulkheadCustomizer);
        registerEventConsumer(bulkheadRegistry, bulkheadEventConsumerRegistry,
            bulkheadConfigurationProperties);
        bulkheadConfigurationProperties.getInstances().forEach((name, properties) ->
            bulkheadRegistry
                .bulkhead(name, bulkheadConfigurationProperties
                    .createBulkheadConfig(properties, compositeBulkheadCustomizer,
                        name)));
        return bulkheadRegistry;
    }
@Test
    public void testBulkHeadRegistry() {
        //Given
        io.github.resilience4j.common.bulkhead.configuration.CommonBulkheadConfigurationProperties.InstanceProperties instanceProperties1 = new io.github.resilience4j.common.bulkhead.configuration.CommonBulkheadConfigurationProperties.InstanceProperties();
        instanceProperties1.setMaxConcurrentCalls(3);
        assertThat(instanceProperties1.getEventConsumerBufferSize()).isNull();

        io.github.resilience4j.common.bulkhead.configuration.CommonBulkheadConfigurationProperties.InstanceProperties instanceProperties2 = new io.github.resilience4j.common.bulkhead.configuration.CommonBulkheadConfigurationProperties.InstanceProperties();
        instanceProperties2.setMaxConcurrentCalls(2);
        assertThat(instanceProperties2.getEventConsumerBufferSize()).isNull();

        BulkheadConfigurationProperties bulkheadConfigurationProperties = new BulkheadConfigurationProperties();
        bulkheadConfigurationProperties.getInstances().put("backend1", instanceProperties1);
        bulkheadConfigurationProperties.getInstances().put("backend2", instanceProperties2);

        BulkheadConfiguration bulkheadConfiguration = new BulkheadConfiguration();
        DefaultEventConsumerRegistry<BulkheadEvent> eventConsumerRegistry = new DefaultEventConsumerRegistry<>();

        //When
        BulkheadRegistry bulkheadRegistry = bulkheadConfiguration
            .bulkheadRegistry(bulkheadConfigurationProperties, eventConsumerRegistry,
                new CompositeRegistryEventConsumer<>(emptyList()), new CompositeCustomizer<>(
                    Collections.emptyList()));

        //Then
        assertThat(bulkheadRegistry.getAllBulkheads().size()).isEqualTo(2);
        Bulkhead bulkhead1 = bulkheadRegistry.bulkhead("backend1");
        assertThat(bulkhead1).isNotNull();
        assertThat(bulkhead1.getBulkheadConfig().getMaxConcurrentCalls()).isEqualTo(3);

        Bulkhead bulkhead2 = bulkheadRegistry.bulkhead("backend2");
        assertThat(bulkhead2).isNotNull();
        assertThat(bulkhead2.getBulkheadConfig().getMaxConcurrentCalls()).isEqualTo(2);

        assertThat(eventConsumerRegistry.getAllEventConsumer()).hasSize(2);
    }