Let records be stream/collection and extract function which transforms data form an element of such collection.
records
extract
Is there a way in Kotlin to
you could use method reference (similar to Java).
records.map {::extract}
take a look at the function references examples on kotlin docs https://kotlinlang.org/docs/reference/reflection.html#function-references