• Skip to primary navigation
  • Skip to content
  • Skip to footer
EqualsVerifier by Jan Ouwens
  • /
  • Blog
  • Talks
  • EqualsVerifier

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

    • GitHub
    • Stack Overflow
    • Made by Jan Ouwens
    • Bluesky
    • Mastodon

    Manual

    These pages will quickly get you up and running with EqualsVerifier, and help you configure it in situations where the default behaviour is too strict.

    • Why, what, how?
    • Getting started
    • What does a good equals method look like?
    • Making things final
    • Immutability
    • instanceof or getClass()
    • Dealing with null
    • Ignoring fields
    • Testing several classes at once
    • Handling inheritance
    • JPA entities
    • Cached hashCodes
    • Relaxed equality
    • Dealing with legacy systems
    • The Java Platform Module System
    • What are these prefab values?
    • Additional resources
    • Privacy policy
    • Climate considerations
    • Bluesky
    • Mastodon
    • GitHub
    • Feed
    © 2025 EqualsVerifier. Powered by Jekyll & Minimal Mistakes.