code: private void awaitState(State expectedState) throws Exception {
      while (this.lifeCycle.getState() != expectedState) {
        try {
          Thread.sleep(1);
        } catch (InterruptedException e) {
          // We do not know why this happened.
          // We do not know how to handle it, either.
          throw e;
        }
      }
    }
docs: Waits for the life cycle to reach the expected state
  waiting for 1 milli-second in between. If an
  {@link InterruptedException} occurs, basically it gives up
  the effort.
  
  @param expectedState
  @throws Exception most likely if an
  {@link InterruptedException} happens during waiting