cleanup

- replace private Collection with array for performance and simplicity
- replace foreach loops with index-based since we want early termination
- replace static initializer block with inline initialization
add PMD rulesets: controversial, migrating, type resolution