         XCTAssertEqual(empty!, [])
     }
 }
+
+// MARK: - Helper methods
+extension ResetTests {
+    func assertClientsHaveGUIDsFromStorage(_ storage: RemoteClientsAndTabs, expected: [GUID]) {
+        let recs = storage.getClients().value.successValue
+        XCTAssertNotNil(recs)
+        XCTAssertEqual(expected, recs!.map { $0.guid! })
+    }
+}
+
+// MARK: - MockBrowserProfile
+class MockBrowserProfile: BrowserProfile {
+    var peekSyncManager: BrowserSyncManager {
+        return self.syncManager as! BrowserSyncManager
+    }
+
+    var peekTabs: SQLiteRemoteClientsAndTabs {
+        return self.remoteClientsAndTabs as! SQLiteRemoteClientsAndTabs
+    }
+}
+
+// MARK: - MockEngineStateChanges
+class MockEngineStateChanges: EngineStateChanges {
+    var collections: [String] = []
+    var enabled: [String] = []
+    var disabled: [String] = []
+    var clearLocalCommandsCount = 0
+
+    func collectionsThatNeedLocalReset() -> [String] {
+        return self.collections
+    }
+
+    func enginesEnabled() -> [String] {
+        return self.enabled
+    }
+
+    func enginesDisabled() -> [String] {
+        return self.disabled
+    }
+
+    func clearLocalCommands() {
+        clearLocalCommandsCount += 1
+    }
+}

        assertClientsHaveGUIDsFromStorage(tabs, expected: ["abcdefghijkl"])

        // Tell the sync manager that "clients" has changed syncID.
        let e = MockEngineStateChanges()
        e.collections.append("clients")

        _ = profile.tabs.reopenIfClosed()

        XCTAssertTrue(profile.peekSyncManager.takeActionsOnEngineStateChanges(e).value.isSuccess)

        // We threw away the command.
        XCTAssertTrue(e.clearWasCalled)

        // And now we have no local clients.
        let empty = tabs.getClients().value.successValue

import UIKit

import XCTest

class ResetTests: XCTestCase {
    func testResetting() {
