void (@NotNull List<? super PsiExpression> result, @NotNull PsiElement container) { List<PsiYieldStatement> yields = new ArrayList<>(); addStatements(yields, container, PsiYieldStatement.class, element -> element instanceof PsiSwitchExpression); for (PsiYieldStatement statement : yields) { ContainerUtil.addIfNotNull(result, statement.getExpression()); } }