Why do Kotlin tests (for Gradle projects) have to be inside classes?

I was reading the Kotlin documentation for creating tests, and noticed that it is normal to create test functions inside classes.

Why is this needed?

submitted by /u/S5904
[link] [comments]