diff --git a/core-kotlin/src/main/kotlin/com/baeldung/generic/Reified.kt b/core-kotlin/src/main/kotlin/com/baeldung/generic/Reified.kt new file mode 100644 index 0000000000..37a632fe41 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/generic/Reified.kt @@ -0,0 +1,6 @@ +inline fun Iterable<*>.filterIsInstance() = filter { it is T } + +fun main(args: Array) { + val set = setOf("1984", 2, 3, "Brave new world", 11) + println(set.filterIsInstance()) +} \ No newline at end of file