public boolean remove(long key) {
        if (key < 0) {
            throw new IndexOutOfBoundsException();
        }
        RBNode node = root;
        while(node != null) {
            if (key == node.key) {
                break;
            }
            if (key < node.key) {
                node = node.left;
            }
            else {
                node = node.right;
            }
        }

        if (node == null) {
            return false;
        }

        size--;
        deleteEntry(node);
        return true;
    }
Removes the given key from the set.
@param key the key to remove from the set.
@exception IndexOutOfBoundsException thrown if the given key is not
in the range [0, maxKey].
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/RedBlackLongKeySet.java