PluginContainer implements Iterable<AbstractPlugin>, Serializable { public AbstractPlugin getByName( String pluginName ) { for ( AbstractPlugin plugin : plugins ) { if ( plugin.getName().equals( pluginName ) ) { return plugin; } } return null; } PluginContainer(); int indexOf( AbstractPlugin plugin ); AbstractPlugin getByName( String pluginName ); AbstractPlugin getByIndex( int index ); boolean add( AbstractPlugin plugin ); boolean removeByName( String pluginName ); boolean removeByIndex( int index ); boolean remove( AbstractPlugin plugin ); void clear(); int size(); boolean contains( AbstractPlugin plugin ); @Override Iterator<AbstractPlugin> iterator();  }
@Test public void getByName() { assertTrue( plugins.getByName( "Zwei" ) == p2 ); assertTrue( plugins.getByName( "Vier" ) == null ); }