void (@NotNull JTree tree, @Nullable Object root) { LOG.debug(new IllegalStateException("restore paths")); if (visit(tree)) return; // AsyncTreeModel#accept if (root == null) return; TreeFacade facade = TreeFacade.getFacade(tree); ActionCallback callback = facade.getInitialized().doWhenDone(new TreeRunnable("TreeState.applyTo: on done facade init") { @Override public void perform() { facade.batch(indicator -> applyExpandedTo(facade, new TreePath(root), indicator)); } }); if (tree.getSelectionCount() == 0) { callback.doWhenDone(new TreeRunnable("TreeState.applyTo: on done") { @Override public void perform() { if (tree.getSelectionCount() == 0) { applySelectedTo(tree); } } }); } }