The code I posted is exactly the Kotlin equivalent...
# getting-started
k
The code I posted is exactly the Kotlin equivalent of the Java version you want, no?