Walk me through a deep dive of the equals() and hashCode() contract. How would you design your own custom hashing algorithm for a complex object?