private static List<PsiStatement> collectStatements(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;
  }
private static List<PsiStatement> collectStatements(PsiCodeBlock codeBlock, List<PsiStatement> out)