### Question:
DefaultCapabilityManager implements ICapabilityManager { public void registerCapabilityProvider( ICapabilityProvider provider ) { providers.put( provider.getId(), provider ); } protected  DefaultCapabilityManager(); static DefaultCapabilityManager getInstance(); void registerCapabilityProvider( ICapabilityProvider provider ); @Override Set<String> listProviders(); @Override ICapabilityProvider getProvider( String id ); @Override String getId(); @Override Set<String> listCapabilities(); @Override ICapability getCapabilityById( String id ); @Override boolean capabilityExist( String id ); @Override Set<ICapability> getAllCapabilities(); static final String ID; }### Answer:
@Test public void testRegisterCapabilityProvider() throws Exception { Set<String> providers = manager.listProviders(); assertEquals( 0, providers.size() ); ICapabilityProvider iCapabilityProvider = mock( ICapabilityProvider.class ); when(iCapabilityProvider.getId()).thenReturn( "test" ); manager.registerCapabilityProvider( iCapabilityProvider ); providers = manager.listProviders(); assertEquals( 1, providers.size() ); assertEquals( iCapabilityProvider.getId(), providers.iterator().next() ); }