### Question:
BundleClassloaderAwareProcessEngineController extends JmxManagedProcessEngineController { @Override public void stop(PlatformServiceContainer container) { registration.unregister(); processEngineFactory.destroy(); } BundleClassloaderAwareProcessEngineController(ProcessEngineConfiguration processEngineConfiguration, BundleContext context); @Override void start(PlatformServiceContainer contanier); @Override void stop(PlatformServiceContainer container);  }### Answer:
@SuppressWarnings("unchecked") @Test public void stop(){ BundleContext context = mock(BundleContext.class); when(context.getBundle()).thenReturn(mock(Bundle.class)); TestBundleClassloaderAwareProcessEngineController controller = new TestBundleClassloaderAwareProcessEngineController(new StandaloneInMemProcessEngineConfiguration(), context); ServiceRegistration<ProcessEngine> reg = mock(ServiceRegistration.class); controller.setRegistration(reg); controller.stop(null); verify(reg, atLeastOnce()).unregister(); verify(controller.getFactory(), atLeastOnce()).destroy(); }