fun <T> flatten(self: Iterable<T>?, flattenUsing: Closure<out T>?): Collection<T>? { return flatten(self, createSimilarCollection(self), flattenUsing) }
Flatten an Iterable . This Iterable and any nested arrays or collections have their contents ( recursively ) added to the new collection . For any non-Array , non-Collection object which represents some sort of collective type , the supplied closure should yield the contained items ; otherwise , the closure should just return any element which corresponds to a leaf .