This is a list of popular code testing tools. Most of them are free and can be plugged-in to your development and/or build tool.
PMD (free)
The abbreviation PMD does not mean anything but the tool helps scan for problems in your sources, like bugs, dead code, suboptimal code, overcomplicated expressions and duplicate code.
Checkstyle (free)
Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard.
Dependometer (free)
Java-based analysis tool for Java projects. Calculates metrics described by authors like Robert C. Martin, Craig Larman and John Lakos. Analyzes dependencies and detects cycles. Verifies the logical architecture against the physical implementation.
Findbugs (free)
A program which uses static analysis to look for bugs in Java code.
Simian (commercial)
Duplicate code checker.