Fix pmd issues.
Fix findbugs issues.
Prune unnecessary branches and add tests to reach coverage goals.