PsiExpression (PsiStatement statement) { if (statement instanceof PsiExpressionStatement) { return ((PsiExpressionStatement)statement).getExpression(); } if (statement instanceof PsiReturnStatement) { return ((PsiReturnStatement)statement).getReturnValue(); } return null; }