public synchronized void unregister(Cancelable current) {
    TreeNode currentNode = findNodeInTaskTrees(current);    
    if (currentNode instanceof TreeNode) {
      List currentChildren = currentNode.getChildren();
      TreeNode currentParent = currentNode.getParent();
      for (Iterator iter = currentChildren.iterator(); iter.hasNext(); ) {
        Tree child = (Tree)iter.next();
        child.getRoot().setParent(currentParent);
      }
      if (currentParent instanceof TreeNode) { 
        Tree.removeFromParentChildren(currentNode);
        currentParent.getChildren().addAll(currentChildren);        
      } else {
        removeFromTaskTrees(currentNode);
        for (Iterator iter = currentChildren.iterator(); iter.hasNext(); ) {
          addToTaskTrees((Tree)iter.next());
        }
      }
    }
  }