Pregunta de entrevista de BlackRock

Equals and HashCode in Java. Why do we need them?