asReadOnly

fun <T> Set<T>.asReadOnly(): Set<T>

Wraps the Set with a lightweight delegating class that prevents casting back to mutable type


fun <K : Any, V> Map<K, V>.asReadOnly(): Map<K, V>

Wraps the Map with a lightweight delegating class that prevents casting back to mutable type