@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();
    }
  }
@Test
  public void testPluginAdded() throws Exception {
    spoonPluginManager.pluginAdded( plugin1 );

    verify( spoonPerspectiveManager ).addPerspective( spoonPerspective );
    assertEquals( 1, spoonPluginManager.getPlugins().size() );
    assertSame( spoonPluginInterface1, spoonPluginManager.getPlugins().get( 0 ) );
  }