void disconnect(boolean dispose) {
		List<GTreeNode> oldChildren;
		synchronized (this) {
			oldChildren = children;
			children = null;
			parent = null;
		}

		if (oldChildren != null) {
			for (GTreeNode node : oldChildren) {
				node.disconnect(dispose);
				if (dispose) {
					node.dispose();
				}
			}
			oldChildren.clear();
		}
	}
Creates a clone of this node.  The clone should contain a shallow copy of all the node's
attributes except that the parent and children are null.
@return the clone of this object.
@throws CloneNotSupportedException if some implementation prevents itself from being cloned.
Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/CoreGTreeNode.java