### Question:
DefaultExplicitIndexProvider implements IndexProviders, ExplicitIndexProvider { @Override public void registerIndexProvider( String name, IndexImplementation index ) { if ( indexProviders.containsKey( name ) ) { throw new IllegalArgumentException( "Index provider '" + name + "' already registered" ); } indexProviders.put( name, index ); }  @Override void registerIndexProvider( String name, IndexImplementation index ); @Override boolean unregisterIndexProvider( String name ); @Override IndexImplementation getProviderByName( String name ); @Override Iterable<IndexImplementation> allIndexProviders();  }### Answer:
@Test void throwOnAttemptToRegisterProviderWithSameName() { IndexImplementation index = mock( IndexImplementation.class ); String testProviderName = "a"; provider.registerIndexProvider( testProviderName, index ); assertThrows( IllegalArgumentException.class, () -> provider.registerIndexProvider( testProviderName, index ) ); }