DefaultLifecycleController implements LifecycleController { @Override public boolean canStart(String phaseName) { return phaseName != null && (phaseName.equals(Initializable.PHASE_NAME_END) || phaseName.equals(Stoppable.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 testCanStart() throws Exception{ Lifecycle lifecycle = new NoOpLifecycleObject(); try{ lifecycle.start(); Assert.fail(); }catch(Exception e){ } lifecycle.initialize(); lifecycle.start(); lifecycle.stop(); lifecycle.start(); lifecycle.stop(); lifecycle.dispose(); try{ lifecycle.start(); Assert.fail(); }catch(Exception e){ } }