     }
 
 }
+
+extension Array where Element: Hashable {
+    func wmf_containsObjectsInAnyOrderAndMatchesCount(_ other: [Element]) -> Bool {
+        let selfSet = Set(self)
+        let otherSet = Set(other)
+        return otherSet.isSubset(of: selfSet) && self.count == other.count
+    }
+}
+

        
        do {
            let deletedLists = try dataStore.readingListsController.delete(readingListsNamed: readingListNames)
            XCTAssertEqual(deletedLists, readingLists)
        } catch let error {
            XCTAssert(false, "Should be able to delete \(readingListNames) reading lists: \(error)")
        }
    }
    
    func testDeletingNonexistentReadingLists() {
        let readingListNames = ["cattos", "sneks"]
        var readingLists: [ReadingList] = []
        
        do {

        
        do {
            let deletedLists = try dataStore.readingListsController.delete(readingListsNamed: readingListNames)
            XCTAssert(deletedLists.wmf_containsObjectsInAnyOrderAndMatchesCount(readingLists))
        } catch let error {
            XCTAssert(false, "Should attempt to delete \(readingListNames) reading lists: \(error)")
        }
    }
    
    func testCreatingReadingListWithArticles() {
        let readingListName = "foo"
        let articleURLS = [URL(string: "//en.wikipedia.org/wiki/Foo")!, URL(string: "//en.wikipedia.org/wiki/Bar")!]
        let articles = articleURLS.flatMap { (articleURL) -> WMFArticle? in
            return dataStore.fetchOrCreateArticle(with: articleURL)
        }
