filtre kotlin non nul

fun main() {
    val asha = Student(101, "Asha")
    val afra = Student(103, "Afra")
    val studentList = listOf(asha, null, afra, null)
    val filteredList = studentList.filterNotNull().forEach {  
            println(it) 
    }
}
data class Student(val id: Long, val name: String)
Smoggy Snail