setValue

operator fun <S> GroupState<S>.setValue(    thisRef: Any?,     property: KProperty<*>,     value: S?)

(Kotlin-specific) Allows the group state object to be used as a delegate. Will be null if it does not exist.

For example:

groupedDataset.mapGroupsWithState(GroupStateTimeout.NoTimeout()) { key, values, state: GroupState<Int> ->
var s by state
...
}