@Override
	public boolean containsKey(short key) {
		if ((key < 0) || (key > maxKey)) {
			throw new IndexOutOfBoundsException();
		}

		RBNode node = root;
		while (node != null) {
			if (key == node.key) {
				return true;
			}
			if (key < node.key) {
				node = node.left;
			}
			else {
				node = node.right;
			}
		}
		return false;
	}
Returns true if the key is in the set.
@param key the key whose presence is to be tested.
@exception IndexOutOfBoundsException thrown if the given key is not
in the range [0, maxKey].
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/RedBlackKeySet.java