if (splicedNode.parent.left == node) { splicedNode.parent.left = splicedNode; } else { splicedNode.parent.right = splicedNode; }
if (splicedNode.parent == null) { root = splicedNode; } else { if (splicedNode.parent.left == node) { splicedNode.parent.left = splicedNode; } else { splicedNode.parent.right = splicedNode; } }
    public void erase(RBNode node)    {        RBNode splicedChild, splicedNode;        if (node.left == NULL || node.right == NULL)            splicedNode = node;        else        {            // know there is successor 'cause right != NULL            splicedNode = successor(node);        }        if (splicedNode.left != NULL)            splicedChild = splicedNode.left;        else            splicedChild = splicedNode.right;        splicedChild.parent = splicedNode.parent;        if (splicedNode.parent == null)        {            root = splicedChild;        }        else        {            if (splicedNode == splicedNode.parent.left)            {                splicedNode.parent.left = splicedChild;            }            else            {                splicedNode.parent.right = splicedChild;            }        }                boolean splicedBlack = splicedNode.isBlack();        if (node != splicedNode)        {            // now swap the splicedNode into the place of node            // I can't just exchange their data, because            // then iterators might get messed up!            splicedNode.parent = node.parent;            splicedNode.black = node.black;            splicedNode.left = node.left;            splicedNode.right = node.right;                        // fix node's children:            splicedNode.left.parent = splicedNode;            splicedNode.right.parent = splicedNode;                        // and node's parent:            if (splicedNode.parent.left == node)            {                splicedNode.parent.left = splicedNode;            } else {                splicedNode.parent.right = splicedNode;            }                        // set node's left, right, parent AND nodeData            // to be null (not even NULL)            node.left = null;            node.right = null;            node.parent = null;            node.nodeData = null;        }        if (splicedBlack)        {            // perform the fixup from CLR            RBDeleteFixup(splicedChild);        }                size = size - 1;    }