### Question:
DefaultCapabilityManager implements ICapabilityManager { @Override public Set<ICapability> getAllCapabilities() { Set<ICapability> capabilities = new HashSet<ICapability>(); for ( ICapabilityProvider iCapabilityProvider : providers.values() ) { Set<ICapability> caps = iCapabilityProvider.getAllCapabilities(); if ( caps != null ) { capabilities.addAll( caps ); } } return capabilities; } 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 testGetAllCapabilities() throws Exception { ICapabilityProvider iCapabilityProvider = mock( ICapabilityProvider.class ); when(iCapabilityProvider.getId()).thenReturn( "test" ); ICapability capability = mock( ICapability.class ); when(iCapabilityProvider.getAllCapabilities()).thenReturn( new HashSet<ICapability>( Arrays.asList( capability ) ) ); manager.registerCapabilityProvider( iCapabilityProvider ); Set<ICapability> allCapabilities = manager.getAllCapabilities(); assertEquals( 1, allCapabilities.size() ); }