kotlin.test / kotlin.test / assertNotNull assertNotNull Common JVM JS Native 1.0 fun < T : Any > assertNotNull ( actual : T ? , message : String ? = null ) : T (source) Asserts that the actual value is not null , with an optional message . Common JVM JS Native 1.0 inline fun < T : Any , R > assertNotNull ( actual : T ? , message : String ? = null , block : ( T ) -> R ) : Unit (source) Asserts that the actual value is not null , with an optional message and a function block to process the not-null value.