static List<TreeNode<K>> expandAll<K>(List<TreeNode<K>> nodes) { return replaceNodes(nodes, (node) { return node.expanded ? null : node.updateState(expanded: true); }); }