equalsverifier
EqualsVerifier is a Java testing library that automatically validates whether equals() and hashCode() method implementations follow Java's contract rules. It catches common equality bugs in unit tests with minimal setup.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | jqno/equalsverifier |
| Owner | jqno |
| Primary language | Java |
| License | Apache-2.0 — OSI-approved |
| Stars | 739 |
| Forks | 88 |
| Open issues | 4 |
| Latest release | equalsverifier-4.5 (2026-04-17) |
| Last updated | 2026-07-03 |
| Source | https://github.com/jqno/equalsverifier |
What equalsverifier is
A JUnit-compatible test utility for Java that verifies equals/hashCode contract compliance by generating edge cases and property checks. Offers both strict and lenient verification modes; available as standard or zero-dependency JAR.
Get the equalsverifier source
Clone the repository and explore it locally.
git clone https://github.com/jqno/equalsverifier.gitcd equalsverifier# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Add as test-scoped dependency only (Maven scope=test); no runtime footprint.
- Integrate into existing JUnit test suites; typical test is 2-3 lines of code.
- Offers lenient mode (.simple()) for stricter equals contracts; choose mode based on team standards.
- Examine error messages carefully; they document equality contract violations and required fixes rather than false positives.
- Zero external dependencies available via equalsverifier-nodep variant if needed for classpath isolation.
When to avoid it — and what to weigh
- Non-Java tech stack — EqualsVerifier is Java-only; projects using Python, Go, Rust, or other languages cannot use it directly.
- Minimal or functional codebases — Teams favoring immutable records, value types, or generated equals (Lombok, records) may have less need; modern Java's record keyword auto-generates correct equals/hashCode.
- Very lightweight projects or scripts — Small utilities with few domain objects or those avoiding unit tests entirely will not benefit from this test-time dependency.
- Legacy JDK versions below Java 8 — Unknown compatibility; verify against your target JDK before adoption in older codebases.
License & commercial use
Licensed under Apache License 2.0, a permissive open-source license.
Apache 2.0 is OSI-approved and generally safe for commercial use in closed-source software. You may use, modify, and distribute EqualsVerifier in proprietary products, provided you retain license notices and provide attribution. No commercial support tier is evident from available data; review project communication channels for support options.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Strong |
| Assessment confidence | High |
EqualsVerifier is a test-time dependency with no network exposure or sensitive data handling. As a test utility, it has no direct security posture; security impact is indirect via improved code quality (correct equality prevents logic bugs in authentication, caching, collections). No known published vulnerabilities evident from provided data. Review dependency tree for transitive risks if using standard JAR; zero-dependency variant mitigates this.
Alternatives to consider
Manual unit tests (hand-written assertions)
More verbose and error-prone; requires deep knowledge of equals contract; harder to maintain as classes evolve.
IDE auto-generation (IntelliJ, Eclipse)
Generates correct code but does not verify it; does not catch subsequent bugs if equals is edited. IDE support is complementary, not a replacement.
Lombok @EqualsAndHashCode or Java records
Auto-generates correct implementations and reduces boilerplate; good for greenfield projects but cannot verify legacy code or custom implementations.
Build on equalsverifier with DEV.co software developers
Adopt EqualsVerifier in your next test suite to eliminate silent equality bugs in production. Start with one test in 2 lines of code.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
equalsverifier FAQ
Does EqualsVerifier work with Java records?
What Java versions are supported?
Can I use EqualsVerifier in production code?
How strict is the default mode?
Software developers & web developers for hire
DEV.co helps companies turn open-source tools like equalsverifier into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source testing stack.
Strengthen Your Java Equality Contracts
Adopt EqualsVerifier in your next test suite to eliminate silent equality bugs in production. Start with one test in 2 lines of code.