code: public void swap(Tree<T> node) {
      Tree<T> thisParent = this.parent;
      List<Tree<T>> thisChildren = new ArrayList<>(this.children);
  
      this.removeFromParent();
      if (node.parent != null) {
        node.parent.add(this);
      }
      node.children.forEach(this::add);
  
      node.removeFromParent();
      if (thisParent != null) {
        thisParent.add(node);
      }
      thisChildren.forEach(node::add);
    }
docs: Swap with the given node. Even they are in different trees.
  
  @param node