Useless code is also hidden in:
- Empty blocks inside switch/try/catch/finally/if/for/while statements (PMD)
- if(s) with a condition that can never be true (PMD?)
- unused local variables, parameters and private methods (PMD)
There are surely more than that. Please consider this as a non exhaustive list of ideas.