### Question:
NamedClusterEmbedManager { public void clear() { NamedClusterServiceOsgi ncso = meta.getNamedClusterServiceOsgi(); if ( ncso != null ) { addedAllClusters = false; addedAnyClusters = false; if ( embeddedMetaStoreFactory != null ) { try { List<NamedClusterOsgi> list = embeddedMetaStoreFactory.getElements(); for ( NamedClusterOsgi nc : list ) { namedClusterPool.put( nc.getName(), nc ); embeddedMetaStoreFactory.deleteElement( nc.getName() ); } } catch ( MetaStoreException e ) { logMetaStoreException( e ); } } } } NamedClusterEmbedManager( AbstractMeta meta, LogChannelInterface log ); void registerUrl( String urlString ); void clear(); boolean isAddedAnyClusters(); void addClusterToMeta( String clusterName ); void passEmbeddedMetastoreKey( VariableSpace nameSpace, String embeddedMetastoreProviderKey ); static final String NAMESPACE; }### Answer:
@Test public void testClear() throws Exception { when( mockMetaStoreFactory.getElements() ) .thenReturn( Arrays.asList( new NamedClusterOsgi[] { mockNamedCluster1, mockNamedCluster2 } ) ); namedClusterEmbedManager.clear( ); verify( mockMetaStoreFactory ).deleteElement( CLUSTER1_NAME ); verify( mockMetaStoreFactory ).deleteElement( CLUSTER2_NAME ); }