                 let ids = [id1, id2]
                 let fetchedRecords = try Item.filter(keys: ids).fetchAll(db)
                 XCTAssertEqual(fetchedRecords.count, 2)
-                XCTAssertEqual(Set(fetchedRecords.map { $0.name! }), Set([record1, record2].map { $0.name! }))
+                let fetchedNames = Set(fetchedRecords.map { $0.name! })
+                let expectedNames = Set([record1, record2].map { $0.name! })
+                XCTAssertEqual(fetchedNames, expectedNames)
             }
         }
     }

                let ids = [id1, id2]
                let cursor = try Item.fetchCursor(db, keys: ids)
                let fetchedRecords = try [cursor.next()!, cursor.next()!]
                XCTAssertEqual(Set(fetchedRecords.map { $0.name! }), Set([record1, record2].map { $0.name! }))
                XCTAssertTrue(try cursor.next() == nil) // end
            }
        }

                let ids = [id1, id2]
                let fetchedRecords = try Item.fetchAll(db, keys: ids)
                XCTAssertEqual(fetchedRecords.count, 2)
                let fetchedNames = Set(fetchedRecords.map { $0.name! })
                let expectedNames = Set([record1, record2].map { $0.name! })
                XCTAssertEqual(fetchedNames, expectedNames)
            }
        }
    }
