code: public KType indexReplace(int index, KType equivalentKey) {
      assert index >= 0 : "The index must point at an existing key.";
      assert index <= mask ||
             (index == mask + 1 && hasEmptyKey);
      assert Intrinsics.equals(this, keys[index], equivalentKey);
  
      KType previousValue = Intrinsics.<KType> cast(keys[index]);
      keys[index] = equivalentKey;
      return previousValue;
    }
docs: Replaces the existing equivalent key with the given one and returns any previous value
  stored for that key.
  
  @see #indexOf
  
  @param index The index of an existing key.
  @param equivalentKey The key to put in the set as a replacement. Must be equivalent to
  the key currently stored at the provided index.
  @return Returns the previous key stored in the set.
  @throws AssertionError If assertions are enabled and the index does
  not correspond to an existing key.