LifecycleListener listener = (LifecycleListener) context.getBean("listener");
assertFalse(lifecycleBean.isRunning());
context.start();
assertTrue(lifecycleBean.isRunning());
assertEquals(0, listener.getStoppedCount());
context.stop();
assertFalse(lifecycleBean.isRunning());
assertEquals(1, listener.getStoppedCount());
assertSame(context, listener.getApplicationContext());
}