What happens if hashCode() and equals() are not overridden correctly in HashMap?

If hashCode() and equals() are not overridden correctly in a HashMap, it can lead to unexpected behavior, such as incorrect key lookups…