### Question:
ContextShutdownHandler { void handleStop(Bundle bundle) { if (bundle == null) { throw new IllegalArgumentException("Method argument bundle must not be null."); } this.logger.info("Removing infrastructure for bundle: " + bundle + "..."); this.modelRegistrar.unregister(bundle); this.dispatcherServlet.disableMvc(bundle); this.logger.info("Infrastructure for {} removed.", bundle); }    }### Answer:
@Test(expected = IllegalArgumentException.class) public void testBundleMustNotBeNull() { withNullBundle(); handleStop(); }
@Test public void testOrderOfShutdownEvents() { handleStop(); }
@Test public void testBundleIsRemovedFromModelRegistrarAndDispatcherServletUsingEventHandlingBarrier() { handleStop(); InOrder inOrder = inOrder(this.modelRegistrar, this.dispatcherServlet); inOrder.verify(this.modelRegistrar).unregister(this.bundle); inOrder.verify(this.dispatcherServlet).disableMvc(this.bundle); }