fun test(obj: Any): String { return when { obj !is Iterable<*> -> "not iterable" obj !is Collection<*> -> "not collection" else -> "unknown" } }