code: public void put(int key, long value) {
          int i = ContainerHelpers.binarySearch(mKeys, mSize, key);
  
          if (i >= 0) {
              mValues[i] = value;
          } else {
              i = ~i;
  
              if (mSize >= mKeys.length) {
                  growKeyAndValueArrays(mSize + 1);
              }
  
              if (mSize - i != 0) {
                  System.arraycopy(mKeys, i, mKeys, i + 1, mSize - i);
                  System.arraycopy(mValues, i, mValues, i + 1, mSize - i);
              }
  
              mKeys[i] = key;
              mValues[i] = value;
              mSize++;
          }
      }
docs: Adds a mapping from the specified key to the specified value,
  replacing the previous mapping from the specified key if there
  was one.