void (@NotNull final Library library) { myModel.invalidateAsync().thenRun(() -> { ((AsyncTreeModel)myTree.getModel()).accept(path -> { return TreeVisitor.Action.CONTINUE; // traverse to update myParentsMap }).onProcessed(path -> { myModel.select(library, myTree, p -> {}); }); }); }