1 min readOct 2, 2020
You gotta take the programming language into account. The equality function in a Java class has to be ready for its parameter to be null. That's just the way things are in Java.
In Scala it's very easy to avoid null, if you're not inter-operating with Java. And for Kotlin, null safety is the most advertised feature, second only to the thing about semicolons.