code: private int findKeyOrInsertPosition(K key) {
      int newPos = 0;
      while (newPos < this.keys.length && this.comparator.compare(this.keys[newPos], key) < 0) {
        newPos++;
      }
      return newPos;
    }
docs: This does a linear scan which is simpler than a binary search. For a small collection size this
  still should be as fast as binary search.