A small JVM test simulates the behavior of a screen model with its own CoroutineScope. After a regression, a background task survives the call to clearOwner() and manages to write extra state. You need to determine the exact output of the program.
ViewModel model is used without the Android SDK, but with the same owner-cleanup scenario.clearOwner() method must:
onCleared();org.jetbrains.kotlinx:kotlinx-coroutines-core.src/main/kotlin/Main.kt file from the task in place../gradlew run
2.0.08.817org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1main()runBlocking, launch, and delay scheduler from kotlinx.coroutines is used without AndroidX and without the real androidx.lifecycle.ViewModelClick a line and write what it prints. Explanation is optional.