### Question:
LocalizationBundleListener implements BundleListener { public void init() throws Exception { bundleContext.addBundleListener( this ); for ( Bundle bundle : bundleContext.getBundles() ) { if ( bundle.getState() == Bundle.ACTIVE ) { bundleChanged( new BundleEvent( BundleEvent.STARTED, bundle ) ); } } }  void setLocalizationManager( LocalizationManager localizationManager ); void setBundleContext( BundleContext bundleContext ); @Override void bundleChanged( BundleEvent event ); void init();  }### Answer:
@Test public void testInit() throws Exception { when( bundle.getState() ).thenReturn( Bundle.ACTIVE ); when( bundleContext.getBundles() ).thenReturn( new Bundle[]{bundle} ); localizationBundleListener.init( ); verify( localizationManager ).bundleChanged( bundle ); }