PsiStatement (@NotNull PsiExpression expr) { Project project = expr.getProject(); PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); return factory.createStatementFromText("yield " + StringUtil.trim(expr.getText()) + ";", expr); }