int getKeyIndex(long key) {

		int min = 0;
		int max = keyCount - 1;

		while (min <= max) {
			int i = (min + max) / 2;
			long k = getKey(i);
			if (k == key) {
				return i;
			}
			else if (k < key) {
				min = i + 1;
			}
			else {
				max = i - 1;
			}
		}
		return -(min + 1);
	}
Perform a binary search to locate the specified key.
@param key key value
@return int key index if found, else -(key index + 1) indicates insertion
point.
Ghidra/Framework/DB/src/main/java/db/LongKeyRecordNode.java