EqualsVerifier can be used in Java unit tests to verify whether the contract for the equals and hashCode methods in a class is met.