private void setUpShowRootNode(ActionToolbar actionToolbar) {
    final var showFull = new Ref<>(false);
    myModel.addTreeModelListener(new TreeModelListener() {
      private volatile boolean called = false;

      @Override
      public void treeNodesChanged(TreeModelEvent e) {
      }

      @Override
      public void treeNodesInserted(TreeModelEvent e) {
        onModelUpdate(e);
      }

      @Override
      public void treeNodesRemoved(TreeModelEvent e) {
        onModelUpdate(e);
      }

      @Override
      public void treeStructureChanged(TreeModelEvent e) {
        onModelUpdate(e);
      }

      private void onModelUpdate(TreeModelEvent e) {
        final Object root = myModel.getRoot();
        if (e.getTreePath().getLastPathComponent() == root) {
          setUpEmptyText();
          final int childCount = myModel.getChildCount(root);
          final boolean showRoot = childCount > 1 || childCount == 1 && showFull.get();
          if (showRoot && !myStateBean.isShowOnlyModified() && !myStateBean.isHideFullyCovered()) {
            showFull.set(true);
          }
          if (showRoot != myTable.getTree().isRootVisible()) {
            myTable.getTree().setRootVisible(showRoot);
          }
          if (!called) {
            var nodeRoot = myModel.getCoverageNode(root);
            if (nodeRoot != null) {
              called = true;
              setWidth(nodeRoot);
              resetIfAllFiltered(nodeRoot, actionToolbar);
              logTotalCoverage(nodeRoot);
            }
          }
        }
      }
    });
  }
private void setUpShowRootNode(ActionToolbar actionToolbar)