Java Language Specification, Version Java SE 21 Edition
4.2.5. The boolean Type and boolean Values5 Documented Misconceptions
ComparisonWithBooleanLiteral
To test whether an expression is true or false, one must compare it to true or to false
MapToBooleanWithConditionalOperator
To map a boolean expression to a boolean, a conditional operator is necessary
MapToBooleanWithIf
To map a boolean expression to a boolean, an if statement is necessary
NumericToBooleanCoercion
Numeric types can be coerced to boolean
ReferenceToBooleanCoercion
Every reference type can be coerced to boolean