withAssociatedValueAndRemove

fun withAssociatedValueAndRemove(token: T, block: (V) -> Unit)

Applies block on the associated value of token, if any, and removes the associated value, if any, afterwards.

block is not invoked when the token is not mapped.