private int getKeyIndex(int key) {
    reindexItems();

    int index = Arrays.binarySearch(sortedKeys, key);
    if (index >= 0) {
      int prevIndex = index - 1;
      while (prevIndex >= 0 && sortedKeys[prevIndex] == key) {
        index = prevIndex;
        prevIndex = index - 1;
      }
      return index;
    } else {
      return -1;
    }
  }
private int getKeyIndex ( int key ) { reindexItems ( ) ; int index = Arrays . binarySearch ( sortedKeys , key ) ; if ( index >= 0 ) { int prevIndex = index - 1 ; while ( prevIndex >= 0 && sortedKeys [ prevIndex ] == key ) { index = prevIndex ; prevIndex = index - 1 ; } return index ; } else { return - 1 ; } }
Finds the first index in {@code sortedKeys} containing
{@code key}.

@param key
@return