If I have a nullable Boolean b, I can do the following comparison in Java:
Boolean b
Boolean b = ...; if (b != null && b) { /* Do something */
You can compare nullable boolean with true, false or null using equality operator:
true
false
null
var b: Boolean? = null if (b == true) { // b was not null and equal true } if (b == false) { // b is false } if (b != true) { // b is null or false }