commit | f8b8bc50151646756d9e110941bc1f9c53dab349 | [log] [tgz] |
---|---|---|
author | bhagwani <bhagwani@google.com> | Sat Oct 20 08:09:23 2018 -0700 |
committer | Ron Shapiro <shapiro.rd@gmail.com> | Tue Oct 23 12:24:10 2018 -0400 |
tree | ae639f1c39ee70a9f8ca738dc1c72cbbb406b011 | |
parent | 4628eb07dbe26cc7bb2fb8ac6664eca250146256 [diff] |
Suppress warnings in classes that implement equals() without also implementing hashCode(). The contract for Object.hashCode states that if two objects are equal, then calling the hashCode() method on each of the two objects must produce the same result. Implementing equals() but not hashCode() causes broken behaviour when trying to store the object in a collection. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=218007454
Truth makes your test assertions and failure messages more readable. Similar to AssertJ, it natively supports many JDK and Guava types, and it is extensible to others.
Truth is owned and maintained by the Guava team. It is used from the majority of the tests in Google’s own codebase.
Read more at the main website.