protected TreeNode<K, D> successor(TreeNode<K, D> node) {
        if (!isNil(node.getRightChild())) {
            return getMinNode(node.getRightChild());
        }
        TreeNode<K, D> parent = node.getParent();
        while (!isNil(parent) && node == parent.getRightChild()) {
            node = parent;
            parent = node.getParent();
        }
        return parent;
    }