`runTest { }` from kotlinx-coroutines-test gives you a virtual time scheduler — `delay(1000)` finishes instantly while preserving ordering. No more flaky 1-second test sleeps.
`LaunchedEffect(key)` runs a coroutine when the key changes. Use for one-shot init, snapshot listening, data loading, or any suspend work tied to a composition.
Lift state UP to where it's needed. A composable becomes "stateless" (taking `value` + `onValueChange`) which makes it reusable and testable. The Compose mantra.
Compile-time code generation for JSON serialization. Annotate `@Serializable` on a data class; `Json.encodeToString` and `Json.decodeFromString` are typed.
`List<*>` means "list of something I don't need to know exactly" — read-only with Any? as element type. Useful when you genuinely don't care about the parameter.
`ReentrantLock` does what `synchronized` does, plus: tryLock with timeout, fair queueing, interruptible acquire, multiple condition variables. Use when synchronized's rigidity bites.
`Flow<T>` is a coroutine-based reactive stream — like Sequence but async. Cold (each collector restarts the producer) and respects cancellation. The backbone of modern Kotlin/Android reactive code.
Cancellation is cooperative — your coroutine must check via `ensureActive()`, `yield()`, or any other suspending call. CPU-busy loops without a suspend point are NOT cancellable.
Set-style ops on collections. `distinct` removes duplicates; `distinctBy` lets you key the dedupe by a derived value; `union/intersect/subtract` give you set operations.
`zip` pairs elements positionally; the result is the length of the shorter list. `withIndex()` gives you `(index, value)` pairs without the manual `forEachIndexed`.
`associateBy` builds a `Map<K, T>` keyed by a derived value. `associateWith` keys by the items themselves with derived values. `associate` lets you build both key and value from each item.