/**
  * 进入一个活跃状态,如果状态是原子状态,添加到当前的states Enter an active state If the state is atomic also record it add
  * it to the current states
  *
  * @param state state to enter
  */
 public void enterState(final EnterableState state) {
   if (!activeStates.add(state)) {
     throw new IllegalStateException("State " + state.getId() + " already added.");
   }
   if (state.isAtomicState()) {
     if (!atomicStates.add(state)) {
       throw new IllegalStateException("Atomic state " + state.getId() + " already added.");
     }
   }
 }