Kotlin make copy() to avoid mutability

In Kotlin, using data class combined with the copy() function is a powerful and idiomatic way to achieve immutability while still allowing…