Merge collapsible "if" statements
Suppress some PMD warnings