@RequiresReadLock
  @Nullable
  public static PsiElement getFirstElementOnTheLine(@NotNull PsiLambdaExpression lambda, Document document, int line) {
    TextRange lineRange = DocumentUtil.getLineTextRange(document, line);
    if (!intersects(lineRange, lambda)) return null;
    PsiElement body = lambda.getBody();
    if (body == null || !intersects(lineRange, body)) return null;

    if (body instanceof PsiCodeBlock) {
      PsiStatement[] statements = ((PsiCodeBlock)body).getStatements();
      if (statements.length == 0) {
        // empty lambda
        LOG.assertTrue(lineRange.contains(body.getTextOffset()));
        return body;
      }
      for (PsiStatement statement : statements) {
        // return first statement starting on the line
        var found = getFirstElementOnTheLine(lineRange, statement);
        if (found != null) {
          return found;
        }
      }
    }
    else {
      // check expression body
      var found = getFirstElementOnTheLine(lineRange, body);
      if (found != null) {
        return found;
      }
    }

    return null;
  }
@RequiresReadLock
  @Nullable
  public static PsiElement getFirstElementOnTheLine(@NotNull PsiLambdaExpression lambda, Document document, int line)