### Question:
SpoonPluginManager implements PluginTypeListener { @Override public void pluginAdded( final Object serviceObject ) { try { SpoonPluginInterface spoonPluginInterface = (SpoonPluginInterface) getPluginRegistry().loadClass( (PluginInterface) serviceObject ); if ( plugins.get( serviceObject ) != null ) { return; } SpoonPluginCategories categories = spoonPluginInterface.getClass().getAnnotation( SpoonPluginCategories.class ); if ( categories != null ) { for ( String cat : categories.value() ) { List<SpoonPluginInterface> categoryList = pluginCategoryMap.get( cat ); if ( categoryList == null ) { categoryList = new ArrayList<>(); pluginCategoryMap.put( cat, categoryList ); } categoryList.add( spoonPluginInterface ); } } if ( spoonPluginInterface.getPerspective() != null ) { getSpoonPerspectiveManager().addPerspective( spoonPluginInterface.getPerspective() ); } plugins.put( serviceObject, spoonPluginInterface ); } catch ( KettlePluginException e ) { e.printStackTrace(); } } private  SpoonPluginManager(); @Override void pluginAdded( final Object serviceObject ); @Override void pluginRemoved( Object serviceObject ); @Override void pluginChanged( Object serviceObject ); static SpoonPluginManager getInstance(); void applyPluginsForContainer( final String category, final XulDomContainer container ); List<SpoonPluginInterface> getPlugins(); void notifyLifecycleListeners( SpoonLifecycleListener.SpoonLifeCycleEvent evt );  }### Answer:
@Test public void testPluginAdded() throws Exception { spoonPluginManager.pluginAdded( plugin1 ); verify( spoonPerspectiveManager ).addPerspective( spoonPerspective ); assertEquals( 1, spoonPluginManager.getPlugins().size() ); assertSame( spoonPluginInterface1, spoonPluginManager.getPlugins().get( 0 ) ); }