 }
 
 class MockFunction<T: Hashable, ReturnType: DefaultConstructable>: MockFunctionWithBoundDefaultReturn<T, ReturnType> {
-    init(binding: Binding<T>, returnValue: ReturnType) {
-        super.init(bindings: [binding: returnValue], defaultReturn: ReturnType())
+    init(bindings: Bindings) {
+        super.init(bindings: bindings, defaultReturn: ReturnType())
     }
 }
 
-class MockFunctionWithoutDefaultReturn<T: Hashable, ReturnType> {
-    typealias Signature = (T) -> ReturnType
-    typealias TBinding = Binding<T>
-
-    var bindings: [TBinding: ReturnType] = [:]
-
-    init(binding: Binding<T>, returnValue: ReturnType) {
-        bindings[binding] = returnValue
+class MockFunctionWithoutDefaultReturn<T: Hashable, ReturnType>: _MockFunction<T, ReturnType> {
+    override init(bindings: Bindings) { // FIXME: why is this needed?
+        super.init(bindings: bindings)
     }
 
     func orElse(defaultReturn: ReturnType) -> MockFunctionWithBoundDefaultReturn<T, ReturnType> {


extension String: DefaultConstructable {}

class MockFunctionWithBoundDefaultReturn<T: Hashable, ReturnType> {
    typealias Signature = (T) -> ReturnType
    typealias TBinding = Binding<T>

    var bindings: [TBinding: ReturnType] = [:]
    var invocationCount = 0
    let defaultReturn: ReturnType

    init(bindings: [TBinding : ReturnType], defaultReturn: ReturnType) {
        self.bindings = bindings
        self.defaultReturn = defaultReturn
    }

    func unbox() -> Signature {

    }

    func then<ReturnType>(returnValue: ReturnType) -> MockFunctionWithoutDefaultReturn<T, ReturnType> {
        return MockFunctionWithoutDefaultReturn<T, ReturnType>(bindings: [self: returnValue])
    }

    func then<ReturnType: Hashable>(returnValue: ReturnType) -> MockFunction<T, ReturnType> {
        return MockFunction<T, ReturnType>(bindings: [self: returnValue])
    }
}

