kotlin for comparison: ``` class Producer(private ...
# random
k
kotlin for comparison:
Copy code
class Producer(private val queue: BlockingQueue) : Runnable {
  override fun run() = try {
    while (true) queue.put(produce())
  } catch(e: InterruptedException) {
    // handle
  }

  fun produce(): Any { ... }
}
9 lines idiomatic Kotlin vs. 10 lines compressed java and I even put the
catch
body on separate lines and used a blank line between the functions