Ok, perhaps the check is most useful for the first state, for which we don't do a `stateMap.get()`, but I'll keep it for symmetry (with a single loop ;))