gt:         TreeItem<String> newRoot = new TreeItem<>();
context: /*
   * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this
   * particular file as subject to the "Classpath" exception as provided
   * by Oracle in the LICENSE file that accompanied this code.
   *
   * This code is distributed in the hope that it will be useful, but WITHOUT
   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   * version 2 for more details (a copy is included in the LICENSE file that
   * accompanied this code).
   *
   * You should have received a copy of the GNU General Public License version
   * 2 along with this work; if not, write to the Free Software Foundation,
   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   *
   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  
  package test.javafx.scene.control;
  
  import javafx.scene.control.skin.TreeTableCellSkin;
  import test.com.sun.javafx.scene.control.infrastructure.StageLoader;
  import test.com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
  import javafx.scene.control.TreeItem;
  import javafx.scene.control.TreeTableCell;
  import javafx.scene.control.TreeTableCellShim;
  import javafx.scene.control.TreeTableColumn;
  import javafx.scene.control.TreeTableRow;
  import javafx.scene.control.TreeTableView;
  import javafx.util.Callback;
  import org.junit.Before;
  import org.junit.Ignore;
  import org.junit.Test;
  
  import static test.com.sun.javafx.scene.control.infrastructure.ControlTestUtils.*;
  import static org.junit.Assert.*;
  
  public class TreeTableCellTest {
      private TreeTableCell<String, String> cell;
      private TreeTableView<String> tree;
      private TreeTableRow<String> row;
  
      private static final String ROOT = "Root";
      private static final String APPLES = "Apples";
      private static final String ORANGES = "Oranges";
      private static final String PEARS = "Pears";
  
      private TreeItem<String> root;
      private TreeItem<String> apples;
      private TreeItem<String> oranges;
      private TreeItem<String> pears;
  
      @Before public void setup() {
          cell = new TreeTableCell<String, String>();
  
          root = new TreeItem<>(ROOT);
          apples = new TreeItem<>(APPLES);
          oranges = new TreeItem<>(ORANGES);
          pears = new TreeItem<>(PEARS);
          root.getChildren().addAll(apples, oranges, pears);
  
          tree = new TreeTableView<String>(root);
          root.setExpanded(true);
  
          row = new TreeTableRow<>();
      }
  
      /*********************************************************************
       * Tests for the constructors                                        *
       ********************************************************************/
  
      @Test public void styleClassIs_tree_cell_byDefault() {
          assertStyleClassContains(cell, "tree-table-cell");
      }
  
      // The item should be null by default because the index is -1 by default
      @Test public void itemIsNullByDefault() {
          assertNull(cell.getItem());
      }
  
      /*********************************************************************
       * Tests for the item property. It should be updated whenever the    *
       * index, or treeView changes, including the treeView's items.       *
       ********************************************************************/
  
      @Ignore // TODO file bug!
      @Test public void itemMatchesIndexWithinTreeItems() {
          cell.updateIndex(0);
          cell.updateTreeTableView(tree);
          assertSame(ROOT, cell.getItem());
          assertSame(root, cell.getTreeTableRow().getTreeItem());
          cell.updateIndex(1);
          assertSame(APPLES, cell.getItem());
          assertSame(apples, cell.getTreeTableRow().getTreeItem());
      }
  
      @Ignore // TODO file bug!
      @Test public void itemMatchesIndexWithinTreeItems2() {
          cell.updateTreeTableView(tree);
          cell.updateIndex(0);
          assertSame(ROOT, cell.getItem());
          assertSame(root, cell.getTreeTableRow().getTreeItem());
          cell.updateIndex(1);
          assertSame(APPLES, cell.getItem());
          assertSame(apples, cell.getTreeTableRow().getTreeItem());
      }
  
      @Test public void itemIsNullWhenIndexIsOutOfRange() {
          cell.updateIndex(50);
          cell.updateTreeTableView(tree);
          assertNull(cell.getItem());
      }
  
      @Test public void treeItemIsNullWhenIndexIsOutOfRange() {
          cell.updateIndex(50);
          cell.updateTreeTableRow(row);
          cell.updateTreeTableView(tree);
          assertNull(cell.getTreeTableRow().getTreeItem());
      }
  
      @Test public void itemIsNullWhenIndexIsOutOfRange2() {
          cell.updateTreeTableView(tree);
          cell.updateIndex(50);
          assertNull(cell.getItem());
      }
  
      // Above were the simple tests. Now we check various circumstances
      // to make sure the item is updated correctly.
  
      @Ignore // TODO file bug!
      @Test public void itemIsUpdatedWhenItWasOutOfRangeButUpdatesToTreeTableViewItemsMakesItInRange() {
          cell.updateIndex(4);
          cell.updateTreeTableView(tree);
          root.getChildren().addAll(new TreeItem<String>("Pumpkin"), new TreeItem<>("Lemon"));
          assertSame("Pumpkin", cell.getItem());
      }
  
      @Ignore // TODO file bug!
      @Test public void itemIsUpdatedWhenItWasInRangeButUpdatesToTreeTableViewItemsMakesItOutOfRange() {
          cell.updateIndex(2);
          cell.updateTreeTableView(tree);
          assertSame(ORANGES, cell.getItem());
          root.getChildren().remove(oranges);
          assertNull(cell.getTreeTableRow().getTreeItem());
          assertNull(cell.getItem());
      }
  
      @Ignore // TODO file bug!
      @Test public void itemIsUpdatedWhenTreeTableViewItemsIsUpdated() {
          // set cell index to point to 'Apples'
          cell.updateIndex(1);
          cell.updateTreeTableView(tree);
          assertSame(APPLES, cell.getItem());
          assertSame(apples, cell.getTreeTableRow().getTreeItem());
  
          // then update the root children list so that the 1st item (including root),
          // is no longer 'Apples', but 'Lime'
          root.getChildren().set(0, new TreeItem<>("Lime"));
          assertEquals("Lime", cell.getItem());
      }
  
      @Ignore // TODO file bug!
      @Test public void itemIsUpdatedWhenTreeTableViewItemsHasNewItemInsertedBeforeIndex() {
          cell.updateIndex(2);
          cell.updateTreeTableView(tree);
          assertSame(ORANGES, cell.getItem());
          assertSame(oranges, cell.getTreeTableRow().getTreeItem());
          String previous = APPLES;
          root.getChildren().add(0, new TreeItem<>("Lime"));
          assertEquals(previous, cell.getItem());
      }
  
  //    @Test public void itemIsUpdatedWhenTreeTableViewItemsHasItemRemovedBeforeIndex() {
  //        cell.updateIndex(1);
  //        cell.updateTreeTableView(tree);
  //        assertSame(model.get(1), cell.getItem());
  //        String other = model.get(2);
  //        model.remove(0);
  //        assertEquals(other, cell.getItem());
  //    }
  
      @Ignore // TODO file bug!
      @Test public void itemIsUpdatedWhenTreeTableViewItemsIsReplaced() {
          cell.updateIndex(1);
          cell.updateTreeTableView(tree);
          root.getChildren().setAll(new TreeItem<>("Water"), new TreeItem<>("Juice"), new TreeItem<>("Soda"));
          assertEquals("Water", cell.getItem());
      }
  
      @Ignore // TODO file bug!
      @Test public void itemIsUpdatedWhenTreeTableViewIsReplaced() {
          cell.updateIndex(2);
          cell.updateTreeTableView(tree);
  