/** Makes sure that the state is at least the given state. */privatevoid ensure(State state) {
if (state == this.state) {
return;
}
if (state.ordinal() < this.state.ordinal()) {
thrownew IllegalArgumentException("cannot move to " + state + " from " + this.state);
}
state.from(this);
}
/** Makes sure that the state is at least the given state. */privatevoid ensure(State state) {
if (state == this.state) {
return;
}
if (state.ordinal() < this.state.ordinal()) {
thrownew IllegalArgumentException("cannot move to " + state + " from " + this.state);
}
state.from(this);
}