### Question:
DefaultIndexProviderMap extends LifecycleAdapter implements IndexProviderMap { @Override public void init() { Iterable<? extends IndexProvider> indexProviders = dependencies.resolveTypeDependencies( IndexProvider.class ); for ( IndexProvider provider : indexProviders ) { IndexProviderDescriptor providerDescriptor = provider.getProviderDescriptor(); requireNonNull( providerDescriptor ); IndexProvider existing = put( providerDescriptor, provider ); if ( existing != null ) { throw new IllegalArgumentException( "Tried to load multiple schema index providers with the same provider descriptor " + providerDescriptor + ". First loaded " + existing + " then " + provider ); } } initDefaultProvider(); } DefaultIndexProviderMap( DependencyResolver dependencies, Config config ); @Override void init(); @Override IndexProvider getDefaultProvider(); @Override IndexProvider lookup( IndexProviderDescriptor providerDescriptor ); @Override IndexProvider lookup( String providerDescriptorName ); @Override void accept( Consumer<IndexProvider> visitor );  }### Answer:
@Test void shouldNotSupportMultipleProvidersWithSameDescriptor() { IndexProviderDescriptor descriptor = new IndexProviderDescriptor( "provider", "1.2" ); IndexProvider provider1 = mock( IndexProvider.class ); when( provider1.getProviderDescriptor() ).thenReturn( descriptor ); IndexProvider provider2 = mock( IndexProvider.class ); when( provider2.getProviderDescriptor() ).thenReturn( descriptor ); Dependencies dependencies = new Dependencies(); dependencies.satisfyDependency( provider1 ); dependencies.satisfyDependency( provider2 ); assertThrows( IllegalArgumentException.class, () -> createDefaultProviderMap( dependencies, descriptor ).init() ); }