code: public final int findSlotByKey(final K searchKey) {
  		// return Arrays.binarySearch(keys, 0, allocated, searchKey);
  		int low = 0;
  		int high = allocated - 1;
  
  		while (low <= high) {
  			final int mid = (low + high) >>> 1;
  			final K midVal = keys[mid];
  			final int cmp = midVal.compareTo(searchKey);
  
  			if (cmp < 0) {
  				low = mid + 1;
  			} else if (cmp > 0) {
  				high = mid - 1;
  			} else {
  				return mid; // key found
  			}
  		}
  		return -(low + 1);  // key not found.
  	}
docs: Searches using the binary search algorithm. {@link Arrays#binarySearch(Object[], int, int, Object)}
  
  @param key the value to be searched for
  @return index of the search key, if it is contained in the array
  within the specified range;
  otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>. The
  <i>insertion point</i> is defined as the point at which the
  key would be inserted into the array: the index of the first
  element in the range greater than the key,
  or <tt>toIndex</tt> if all
  elements in the range are less than the specified key. Note
  that this guarantees that the return value will be &gt;= 0 if
  and only if the key is found.