Add sample for filterNotNull

This commit is contained in:
adammc331
2020-02-17 19:04:40 -05:00
committed by Ilya Gorbunov
parent e8ee405cdb
commit 840f222867
5 changed files with 17 additions and 0 deletions
@@ -801,4 +801,14 @@ class Collections {
}
}
class Filtering {
@Sample
fun filterNotNull() {
val numbers: List<Int?> = listOf(1, 2, null, 4)
val nonNullNumbers = numbers.filterNotNull()
assertPrints(nonNullNumbers, "[1, 2, 4]")
}
}
}