Revert "Call equals() comparing different types"

This reverts commit bd4561b2b179d7bd930faf141a77bd442fa8a239.