     }
 
 }
+
+
+/// MARK: - Removing individual associations
+
+extension ObjectAssociationTests {
+
+    func testRemovingObjectiveCAssociationsWithObjectiveCTypes() {
+        let objectAssociation = SampleObjectiveCClass(42)
+        objc_setAssociatedObject(objCObject, SampleKey1, objectAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objCObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey1), "The association should have been cleared")
+
+        objc_setAssociatedObject(objCObject, SampleKey1, objCStructAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objCObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey1), "The association should have been cleared")
+
+        objc_setAssociatedObject(objCObject, SampleKey1, objCEnumAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objCObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey1), "The association should have been cleared")
+    }
+
+    func testRemovingObjectiveCAssociationsWithSwiftTypes() {
+        let objectAssociation = SampleSwiftClass(42)
+        objc_setAssociatedObject(objCObject, SampleKey1, objectAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objCObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey1), "The association should have been cleared")
+
+        objc_setAssociatedObject(objCObject, SampleKey1, swiftStructAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objCObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey1), "The association should have been cleared")
+
+        objc_setAssociatedObject(objCObject, SampleKey1, swiftEnumAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objCObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey1), "The association should have been cleared")
+    }
+
+    func testRemovingSwiftAssociationsWithObjectiveCTypes() {
+        let objectAssociation = SampleObjectiveCClass(42)
+        objc_setAssociatedObject(swiftObject, SampleKey1, objectAssociation, .OBJC_ASSOCIATION_RETAIN)
+        swiftObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey1), "The association should have been cleared")
+
+        objc_setAssociatedObject(swiftObject, SampleKey1, objCStructAssociation, .OBJC_ASSOCIATION_RETAIN)
+        swiftObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey1), "The association should have been cleared")
+
+        objc_setAssociatedObject(swiftObject, SampleKey1, objCEnumAssociation, .OBJC_ASSOCIATION_RETAIN)
+        swiftObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey1), "The association should have been cleared")
+    }
+
+    func testRemovingSwiftAssociationsWithSwiftTypes() {
+        let objectAssociation = SampleSwiftClass(42)
+        objc_setAssociatedObject(swiftObject, SampleKey1, objectAssociation, .OBJC_ASSOCIATION_RETAIN)
+        swiftObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey1), "The association should have been cleared")
+
+        objc_setAssociatedObject(swiftObject, SampleKey1, swiftStructAssociation, .OBJC_ASSOCIATION_RETAIN)
+        swiftObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey1), "The association should have been cleared")
+
+        objc_setAssociatedObject(swiftObject, SampleKey1, swiftEnumAssociation, .OBJC_ASSOCIATION_RETAIN)
+        swiftObject.removeAssociationForKey(SampleKey1)
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey1), "The association should have been cleared")
+    }
+
+}
+
+
+/// MARK: - Removing individual associations
+
+extension ObjectAssociationTests {
+
+    func testRemovingAllObjectiveCAssociationsWithObjectiveCTypes() {
+        let objectAssociation = SampleObjectiveCClass(42)
+        objc_setAssociatedObject(objCObject, SampleKey1, objectAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objc_setAssociatedObject(objCObject, SampleKey2, objCStructAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objc_setAssociatedObject(objCObject, SampleKey3, objCEnumAssociation, .OBJC_ASSOCIATION_RETAIN)
+
+        objCObject.removeAllAssociations()
+
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey1), "All associations should have been cleared")
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey2), "All associations should have been cleared")
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey3), "All associations should have been cleared")
+    }
+
+    func testRemovingAllObjectiveCAssociationsWithSwiftTypes() {
+        let objectAssociation = SampleSwiftClass(42)
+        objc_setAssociatedObject(objCObject, SampleKey1, objectAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objc_setAssociatedObject(objCObject, SampleKey2, swiftStructAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objc_setAssociatedObject(objCObject, SampleKey3, swiftEnumAssociation, .OBJC_ASSOCIATION_RETAIN)
+
+        objCObject.removeAllAssociations()
+
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey1), "All associations should have been cleared")
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey2), "All associations should have been cleared")
+        XCTAssertNil(objc_getAssociatedObject(objCObject, SampleKey3), "All associations should have been cleared")
+    }
+
+    func testRemovingAllSwiftAssociationsWithObjectiveCTypes() {
+        let objectAssociation = SampleObjectiveCClass(42)
+        objc_setAssociatedObject(swiftObject, SampleKey1, objectAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objc_setAssociatedObject(swiftObject, SampleKey2, objCStructAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objc_setAssociatedObject(swiftObject, SampleKey3, objCEnumAssociation, .OBJC_ASSOCIATION_RETAIN)
+
+        swiftObject.removeAllAssociations()
+
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey1), "All associations should have been cleared")
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey2), "All associations should have been cleared")
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey3), "All associations should have been cleared")
+    }
+
+    func testRemovingAllSwiftAssociationsWithSwiftTypes() {
+        let objectAssociation = SampleSwiftClass(42)
+        objc_setAssociatedObject(swiftObject, SampleKey1, objectAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objc_setAssociatedObject(swiftObject, SampleKey2, swiftStructAssociation, .OBJC_ASSOCIATION_RETAIN)
+        objc_setAssociatedObject(swiftObject, SampleKey3, swiftEnumAssociation, .OBJC_ASSOCIATION_RETAIN)
+
+        swiftObject.removeAllAssociations()
+
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey1), "All associations should have been cleared")
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey2), "All associations should have been cleared")
+        XCTAssertNil(objc_getAssociatedObject(swiftObject, SampleKey3), "All associations should have been cleared")
+    }
+    
+}

    func testAtomicRetainObjectiveCAssociationWithObjectiveCTypes() {
        autoreleasepool {
            let association = SampleObjectiveCClass(42)
            objCObject.associate(association, withKey: SampleKey, usingPolicy: .OBJC_ASSOCIATION_RETAIN)
            XCTAssertEqual(
                objc_getAssociatedObject(objCObject, SampleKey) as? SampleObjectiveCClass,
                association,
                "The Objective-C object should have an associated Objective-C object"
            )

    func testNonAtomicRetainObjectiveCAssociationWithSwiftTypes() {
        autoreleasepool {
            let association = SampleSwiftClass(42)
            objCObject.associate(association, withKey: SampleKey1, usingPolicy: .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
            XCTAssertEqual(
                objCObject.associationForKey(SampleKey1) as? SampleSwiftClass,
                association,
                "The Objective-C object should have an associated Swift object"
            )
