what's the best way to expose a mutable list as an...
# announcements
u
what's the best way to expose a mutable list as an immutable list while still being able to modify it internally?
Copy code
class Foo() {
    val list: List<String> = ArrayList()

    fun bar() {
        list.add("something") // does not compile, because 'list' is immutable
    }
}