public static <L> Tree<L> spliceNodes(Tree<L> tree, Filter<L> filter) {
    List<Tree<L>> rootList = spliceNodesHelper(tree, filter);
    if (rootList.size() > 1) throw new IllegalArgumentException("spliceNodes: no unique root after splicing");
    if (rootList.size() < 1) return null;
    return rootList.get(0);
  }