code: public StateId forRange(final StateRange range) {
          if (getRange().equals(range)) {
              return this;
          }
  
          return new StateId(stateToken, range);
      }
docs: Convenience method for creating a StateId that has the same token as {@code this} but with the specified range.
  If {@code this} already has the correct range it will just be returned.
  
  @param range The index range
  @return A {@code StateId} with the specified range