DefaultLifecycleController implements LifecycleController { @Override public boolean canInitialize(String phaseName) { return phaseName == null || phaseName.equals(Disposable.PHASE_NAME_END); }  @Override boolean canInitialize(String phaseName); @Override boolean canStart(String phaseName); @Override boolean canStop(String phaseName); @Override boolean canDispose(String phaseName);  }
@Test public void testCanInitialize() throws Exception{ Lifecycle lifecycle = new NoOpLifecycleObject(); lifecycle.initialize(); try{ lifecycle.initialize(); Assert.fail(); }catch(Exception e){ } lifecycle.start(); try{ lifecycle.initialize(); Assert.fail(); }catch(Exception e){ } lifecycle.stop(); try{ lifecycle.initialize(); Assert.fail(); }catch(Exception e){ } lifecycle.dispose(); lifecycle.initialize(); }