 
         history.insertOrUpdatePlace(site.asPlace(), modified: 1234567890).value
         for j in 0...20 {
-            let visitTime = Timestamp(1000 * (1437088398461 + (1000 * i) + j))
+            let visitTime = advanceMicrosecondTimestamp(1437088398461000, by: ((1000000 * i) + (1000 * j)))
             addVisitForSite(site, intoHistory: history, from: .Local, atTime: visitTime)
             addVisitForSite(site, intoHistory: history, from: .Remote, atTime: visitTime)
         }


        history.insertOrUpdatePlace(site.asPlace(), modified: 1234567890).value

        let local = SiteVisit(site: site, date: Timestamp(1000 * 1437088398461), type: VisitType.Link)
        XCTAssertTrue(history.addLocalVisit(local).value.isSuccess)
    }
}

import Foundation
import Shared
import XCTest

func advanceTimestamp(timestamp: Timestamp, by: Int) -> Timestamp {
    return timestamp + UInt64(by)
}

func advanceMicrosecondTimestamp(timestamp: MicrosecondTimestamp, by: Int) -> MicrosecondTimestamp {
    return timestamp + UInt64(by)
}

extension Site {
    func asPlace() -> Place {
