TerminalBlock (@Nullable PsiElement lambdaBody, @NotNull ExistingStreamSource source) { if (lambdaBody instanceof PsiCodeBlock) { return TerminalBlock.from(source, (PsiCodeBlock)lambdaBody); } if (lambdaBody instanceof PsiExpression) { return TerminalBlock.fromStatements(source, new LightExpressionStatement((PsiExpression)lambdaBody)); } return null; }