PsiReturnStatement nextReturnStatement = StreamApiMigrationInspection.getNextReturnStatement(foreachStatement);
<BUG>if (nextReturnStatement == null) return;
</BUG>
PsiExpression orElseExpression = nextReturnStatement.getReturnValue();
<BUG>if (!ExpressionUtils.isSimpleExpression(orElseExpression)) return;
</BUG>
stream = generateOptionalUnwrap(stream, tb, value, orElseExpression, null);
restoreComments(foreachStatement, body);
<BUG>boolean siblings = nextReturnStatement.getParent() == foreachStatement.getParent();

PsiElement result = foreachStatement.replace(elementFactory.createStatementFromText("return " + stream + ";", foreachStatement));
if (siblings) {</BUG>
nextReturnStatement.delete();

PsiReturnStatement nextReturnStatement = StreamApiMigrationInspection.getNextReturnStatement(foreachStatement);
if (nextReturnStatement == null) return null;
PsiExpression orElseExpression = nextReturnStatement.getReturnValue();
if (!ExpressionUtils.isSimpleExpression(orElseExpression)) return null;
stream = generateOptionalUnwrap(stream, tb, value, orElseExpression, null);
restoreComments(foreachStatement, body);
if (nextReturnStatement.getParent() == foreachStatement.getParent()) {
nextReturnStatement.delete();
