I have recently been learning Kotlin. While the original Kotlin Reference is quite good, it certainly contains too much text for me to quick-start with Kotlin after years of Java development. During reading the docs and testing some syntax I’ve made my own Kotlin tutorial, which consists mostly of source code. This is probably the only thing that is required for experienced Java developer to get started.
First let’s check in plain old Java, what is producer and consumer pattern for generics:
Now we can see the same in Kotlin: