Andreas Sinz
03/13/2018, 11:45 AMclass MyImmutableList<T>(private val list: List<T>): List<T> by list
then the user won't be able to cast your list into a MutableList and therefore won't be able to edit itaraqnid
03/13/2018, 1:28 PMaraqnid
03/13/2018, 1:28 PMAndreas Sinz
03/13/2018, 1:42 PMMutableList<T>, Collections.unmodifiableList just throws an exception when you call add