 
     func testAddAndUpdateWithExisingNestedObjects() {
         Realm().beginWrite()
-        let existingObject = Realm().create(SwiftPrimaryStringObject.self, value: ["1", 1])
-        Realm().commitWrite()
-
-        Realm().beginWrite()
-        let object = SwiftLinkToPrimaryStringObject(object: ["1", ["1", 2], []])
+        let existingObject = Realm().create(SwiftPrimaryStringObject.self, value: ["primary", 1])
+        Realm().commitWrite()
+
+        Realm().beginWrite()
+        let object = SwiftLinkToPrimaryStringObject(object: ["primary", ["primary", 2], []])
         Realm().add(object, update: true)
         Realm().commitWrite()
 
         XCTAssertNotNil(object.realm)
-        XCTAssertEqual(object.object!, existingObject)
+        XCTAssertEqual(object.object!, existingObject) // the existing object should be updated
         XCTAssertEqual(existingObject.intCol, 2)
     }
 

    }

    func testCreateWithNestedObjects() {
        let standalone = SwiftPrimaryStringObject(object: ["11", 11])
        Realm().beginWrite()
        let objectWithNestedObjects = Realm().create(SwiftLinkToPrimaryStringObject.self, value: ["11", ["11", 11], [standalone]])
        Realm().commitWrite()

        let stringObjects = Realm().objects(SwiftPrimaryStringObject)
        XCTAssertEqual(stringObjects.count, 1)
        let persistedObject = stringObjects.first!

        XCTAssertNotEqual(standalone, persistedObject)
        XCTAssertEqual(objectWithNestedObjects.object!, persistedObject)
        XCTAssertEqual(objectWithNestedObjects.objects.first!, persistedObject)
    }

    func testUpdateWithNestedObjects() {
        let standalone = SwiftPrimaryStringObject(object: ["11", 11])
        Realm().beginWrite()
        let object = Realm().create(SwiftLinkToPrimaryStringObject.self, value: ["12", standalone, [["11", 12]]], update: true)
        Realm().commitWrite()

        let stringObjects = Realm().objects(SwiftPrimaryStringObject)


    func testUpdateWithObjectsFromAnotherRealm() {
        realmWithTestPath().beginWrite()
        let otherRealmObject = realmWithTestPath().create(SwiftLinkToPrimaryStringObject.self, value: ["primary", NSNull(), [["2", 2], ["4", 4]]])
        realmWithTestPath().commitWrite()

        Realm().beginWrite()
        Realm().create(SwiftLinkToPrimaryStringObject.self, value: ["primary", ["10", 10], [["11", 11]]])
        let object = Realm().create(SwiftLinkToPrimaryStringObject.self, value: otherRealmObject, update: true)
        Realm().commitWrite()

        XCTAssertNotEqual(otherRealmObject, object) // the object from the other realm should be copied into this realm
    }

    // test NSNull for object
