292293294295296297298299300301
if (!state().startsWith("open")) { throw new NotRunning(); } if (!validStates().contains(stateStr)) { throw new CannotStop(); } changeState(stateStr); }
395396397398399400401402
String stateStr = "closed.terminated"; if (!state().equals("open.running")) throw new NotRunning(); if (!validStates().contains(stateStr)) throw new CannotStop(); changeState(stateStr); }
294295296297298299300301302303
397398399400401402403404