@Test
public void testMultipleCategories() {

  Category categoryA = Category.of("A");
  Category categoryB = Category.of("B");
  Category categoryC = Category.of("C");
  FxUtils.runOnFxThread(() -> controller.setRootCategories(ImmutableList.of(categoryA, categoryB, categoryC)));
  waitForFxEvents();
  // Should be three children
  TreeView<Category> tree = lookup(".settings-categories").query();
  ObservableList<TreeItem<Category>> children = tree.getRoot().getChildren();
  assertEquals(3, children.size(), "Three children should be present");
  assertEquals(categoryA, children.get(0).getValue());
  assertEquals(categoryB, children.get(1).getValue());
  assertEquals(categoryC, children.get(2).getValue());
  assertEquals(children.get(0), tree.getSelectionModel().getSelectedItem(), "The first child should be selected");
}