This question has a "kotlin" label only because it\'s code is in kotlin, there\'s nothing kotlin-specific in this example, equivalent java code fails exactly the same