I tried to write the following today:
val extension: Any? = ...;
assertThat(extension).isInstanceOf(WarningsOptionsExtension::class.java)
I was surprised that this was not permitted, because the equivalent in Hamcrest would just fail the assertion if the value was null.
Workaround is to do it in two steps:
assertThat(extension).isNotNull()
assertThat(extension!!).isInstanceOf(WarningsOptionsExtension::class.java)