package fixtures data class Person( val id: Int, val name: String, val email: String ) class Repository { private val items = mutableMapOf() fun add(key: Int, item: T) { items[key] = item } fun find(key: Int): T? = items[key] fun getAll(): List = items.values.toList() } fun add(a: Int, b: Int): Int = a + b fun filter(items: List, predicate: (T) -> Boolean): List { return items.filter(predicate) } fun main() { val repo = Repository() repo.add(1, Person(1, "Alice", "alice@example.com")) repo.add(2, Person(2, "Bob", "bob@example.com")) repo.getAll().forEach { println(it) } println("3 + 4 = ${add(3, 4)}") val numbers = listOf(1, 2, 3, 4, 5) val evens = filter(numbers) { it % 2 == 0 } println("Evens: $evens") }