         }
 
         // Attempt to restore the deleted token
-        let fourthKeychainItem = try keychain.persistentTokenWithIdentifier(keychainItem.identifier)
-        XCTAssertNil(fourthKeychainItem)
-    } catch {
-        XCTFail("Error thrown from keychain: \(error)")
-        return
-    }
+        do {
+            let fourthKeychainItem = try keychain.persistentTokenWithIdentifier(keychainItem.identifier)
+            XCTAssertNil(fourthKeychainItem)
+        } catch {
+            XCTFail("Error thrown from keychain: \(error)")
+            return
+        }
     }
 
     func testDuplicateURLs() {

        }

        // Fetch the token again
        guard let thirdKeychainItem = try keychain.persistentTokenWithIdentifier(keychainItem.identifier) else {
            XCTFail("Failed to recover persistent token with identifier: \(keychainItem.identifier)")
            return
        }
        XCTAssertEqual(thirdKeychainItem.token, modifiedToken)
        XCTAssertEqual(thirdKeychainItem.identifier, keychainItem.identifier)

        // Remove the token
        do {

    let keychain = Keychain.sharedInstance

    func testTokenWithKeychainItemRef() {
        // Create a token
        guard let token = Token.URLSerializer.deserialize(kValidTokenURL) else {
            XCTFail("Failed to construct token from url")
