docs: protected int getIndex(short x) {
      // before the binary search, we optimize for frequent cases
      if ((size == 0) || (keys[size - 1] == x)) {
        return size - 1;
      }
      // no luck we have to go through the list
      return this.binarySearch(0, size, x);
    }