Java is a language where nullable types aren't truthy/falsy. The following code won't compile:
String foo = null;
if (foo) { // error: incompatible types: String cannot be converted to boolean
System.out.println("was true");
} else {
System.out.println("was false");
}
If one changes `if (foo)` to `if (foo != null)`, then the code will compile.