PsiStatement (@Nullable PsiStatement statement) { while (statement instanceof PsiBlockStatement) { PsiStatement[] statements = ((PsiBlockStatement)statement).getCodeBlock().getStatements(); if (statements.length == 0) break; statement = statements[0]; } return statement; }