     }
 }
 
-public func assertHasOneElement<Seq : SequenceType>(collection: Seq, file: String = __FILE__, line: UInt = __LINE__, _ andContinue : (withValue : Seq.Generator.Element) -> Void = { value in return }) {
+public func assertHasOneElement<Seq : Sequence>(_ collection: Seq, file: StaticString = #file, line: UInt = #line, _ andContinue : (_ withValue : Seq.Iterator.Element) -> Void = { value in return }) {
     
     let array = Array(collection)
     if array.count == 1 {
-        andContinue(withValue: array[0])
+        andContinue(array[0])
     } else {
         XCTFail("Collection did not have that value: \(collection)", file: file, line: line)
     }
 }
 
-public func assertHasOneOfType<T, Seq : SequenceType>(values: Seq, file: String = __FILE__, line: UInt = __LINE__, _ andContinue : (withValue : T) -> Void = { value in return }) {
+public func assertHasOneOfType<T, Seq : Sequence>(_ values: Seq, file: StaticString = #file, line: UInt = #line, _ andContinue : (_ withValue : T) -> Void = { value in return }) {
     for value in values {
         if let value = value as? T {
-            andContinue(withValue: value)
+            andContinue(value)
             return
         }
     }

}

public struct ReturnWhen<Args, Return> {
    public typealias WhenMatches = (args: Args) -> Bool
    public let value: Return
    public let when: [WhenMatches]
}

public struct Spy<Args, Return> {
    public typealias WhenMatches = (args: Args) -> Bool
    public typealias Comparison = (expectedArgs: Args, candidateArgs: Args) -> Bool
    public var calls = [Args]()
    
    public var returnValuesWhen = [ReturnWhen<Args, Return>]()

    }
}

public func assertEquals (_ expected: Double, _ actual : Double, delta: Double, file: StaticString = #file, line: UInt = #line ) {
    XCTAssert(abs(expected - actual) <= delta, "Actual: \(actual) was not within \(delta) of \(expected)", file: file, line: line)
}

public func assertEqualsImplementation <T : Equatable> (_ original : T, _ equal : T, _ notEqualObjects : [T], file: StaticString = #file, line: UInt = #line) {
    assertEquals(original, actual: original, file: file, line: line)
    assertEquals(original, actual: equal, file: file, line: line)
    assertEquals(equal, actual: original, file: file, line: line)
