What happens if two objects are considered equal using the `equals()` method but have different hash codes?
Nothing happens. The objects will still be treated as equal, and there will be no impact on the performance or correctness of the program.
Iâ€™m a bit disappointed with this answer. Having different hash codes for equal objects will lead to incorrect behavior in hash-based collections like `HashMap`.
Can you explain how `HashMap` uses `hashCode()` and `equals()` to determine whether two objects are equal?