Lambda operator in TableColumn:: setOnEditCommit()
<p>I use TableView in my code. I want to make cells editable. I found sample on  <a href="http://docs.oracle.com/javafx/2/ui_controls/table-view.htm" rel="nofollow">Oracle site</a> that works excellent</p>

<pre><code>lastNameCol.setCellFactory(TextFieldTableCell.forTableColumn());
lastNameCol.setOnEditCommit(
    new EventHandler&lt;CellEditEvent&lt;Person, String&gt;&gt;() {
       @Override
       public void handle(CellEditEvent&lt;Person, String&gt; t) {
            ((Person) t.getTableView().getItems().get(
                t.getTablePosition().getRow())
                ).setLastName(t.getNewValue());
        }
    }
);
</code></pre>

<p>Then I decided to use lambda operator instead of anonymous class. </p>

<pre><code>lastNameCol.setCellFactory(TextFieldTableCell.&lt;Person&gt;forTableColumn());
lastNameCol.setOnEditCommit(
    (CellEditEvent&lt;Person, String&gt; t) -&gt; {
            ((Person) t.getTableView().getItems().get(
                    t.getTablePosition().getRow())
                    ).setLastName(t.getNewValue());
    });
</code></pre>

<p>I got compiler error. </p>

<blockquote>
  <p>Incompatible types: incompatible parameter types in lambda expression</p>
</blockquote>

<p>But I found this sample on <a href="https://docs.oracle.com/javase/8/javafx/user-interface-tutorial/table-view.htm" rel="nofollow">Oracle site too</a>.</p>

<p>Perhaps this problem is widely known but I didn’t find solution. Why is this code wrong?</p>