   expectTrue(s.contains(TestKeyTy(3030)))
   expectTrue(s.contains(TestKeyTy(4040)))
 
+  // Replace an existing key.
+  s.update(with: TestKeyTy(2020))
+  expectEqual(identity1, s._rawIdentifier())
+  expectEqual(3, s.count)
+  expectTrue(s.contains(TestKeyTy(2020)))
+  expectTrue(s.contains(TestKeyTy(3030)))
+  expectTrue(s.contains(TestKeyTy(4040)))
+
   do {
     let s2: Set<MinimalHashableClass> = []
     MinimalHashableClass.timesEqualEqualWasCalled = 0

  s.insert(4040)
  expectEqual(identity1, s._rawIdentifier())

  // Keep indexes alive during the calls above.
  _fixLifetime(startIndex)
  _fixLifetime(endIndex)

SetTestSuite.test("BridgedFromObjC.Nonverbatim.Contains") {
  var s = getBridgedNonverbatimSet()
  let identity1 = s._rawIdentifier()
  let count1 = s.count
  let capacity1 = s.capacity
  expectTrue(isNativeSet(s))

  expectTrue(s.contains(TestBridgedKeyTy(1010)))
