code: @SuppressWarnings("unchecked")
      public V put(Integer key, V value) {
  
  	int k = checkKey(key);
  	int index = Arrays.binarySearch(keyIndices, k);
  
  	if (index >= 0) {
  	    V old = (V)(values[index]);
  	    values[index] = value;
  	    return old;
  	}
  	else {
  	    int newIndex = 0 - (index + 1);	    
  	    Object[] newValues = Arrays.copyOf(values, values.length + 1);
  	    int[] newIndices = Arrays.copyOf(keyIndices, values.length + 1);
  
  	    // shift the elements down to make room for the new value
  	    for (int i = newIndex; i < values.length; ++i) {
  		newValues[i+1] = values[i];
  		newIndices[i+1] = keyIndices[i];
  	    }
  
  	    // insert the new value
  	    newValues[newIndex] = value;
  	    newIndices[newIndex] = k;
  
  	    // switch the arrays with the lengthed versions
  	    values = newValues;
  	    keyIndices = newIndices;
  	    
  	    return null;
  	}
      }
docs: Adds the mapping from the provided key to the value.
  
  @param key
  @param value
  
  @throws NullPointerException if the key is {@code null}
  @throws IllegalArgumentException if the key is not an instance of {@link
  Integer}