Use Objects.equal() to avoid issues with ==.

Not sure if "==" is overloaded for all object types, so avoid it.