For example, Groovy allows to get text of a file represented by java.nio.file.Path
as follows:
// Groovy code
import java.nio.file.Path
import java.nio.file.Paths
Path p = Paths.get("data.txt")
String text = p.text
I would like to be able to reuse Groovy's text
extension method in Kotlin.
Please note: I know Kotlin has a related method for this particular case. Still, there might be Groovy methods which are useful for Kotlin users.