void (@NotNull TreePath row) { var tree = getTree(); if (!shouldAutoExpand(tree, row.getParentPath())) { return; } if (tree.getModel() instanceof AsyncTreeModel asyncTreeModel) { Object node = row.getLastPathComponent(); if (isAutoExpandAllowed(tree, node)) { asyncTreeModel.onValidThread(() -> tree.expandPath(row)); } } }