package std.util import java.util.* /** Returns a new collection containing the results of applying the given function to each element in this collection */ inline fun java.util.Collection.map(result: Collection = ArrayList(this.size), transform : (T) -> R) : Collection { for (item in this) result.add(transform(item)) return result } /** Returns true if the collection is not empty */ inline fun java.util.Collection.notEmpty() : Boolean = !this.isEmpty() /** Converts the nullable collection into an empty collection if its null */ inline fun java.util.Collection?.notNull() : Collection = if (this != null) this else Collections.EMPTY_LIST as Collection