List<PsiStatement> (PsiCodeBlock codeBlock, List<PsiStatement> out) { for (PsiStatement statement : codeBlock.getStatements()) { if (statement instanceof PsiBlockStatement blockStatement) { collectStatements(blockStatement.getCodeBlock(), out); } else if (!(statement instanceof PsiEmptyStatement)) { out.add(statement); } } return out; }