object Accumulate { fun accumulate(collection: List, function: (T) -> R): List { val retVal = mutableListOf() for(item in collection) { retVal.add(function.invoke(item)) } return retVal } }