         
         c.register({ ImplementsProtocol() as MyProtocol })
         
-        let protocol_ : MyProtocol = c.resolve()!
-        let concreteType : ImplementsProtocol? = c.resolve()
+        let protocol_ = c.resolve()! as MyProtocol
+        let concreteType = c.resolve() as ImplementsProtocol?
         
         XCTAssertNotNil(protocol_)
         XCTAssertNil(concreteType)
+    }
+    
+    func testCanRegisterSameInstanceTwice() {
+        let c  = Container()
+        
+        c.register({ ImplementsProtocol() as MyProtocol })
+        c.register({ (c.resolve()! as MyProtocol) as! ImplementsProtocol })
+        
+        let protocol_ = c.resolve()! as MyProtocol
+        let concreteType = c.resolve()! as ImplementsProtocol
+        
+        XCTAssertNotNil(protocol_)
+        XCTAssertNotNil(concreteType)
+        XCTAssertTrue(protocol_ as! ImplementsProtocol === concreteType)
     }
     
     func testRegisterIsLazilyInvoked() {

        let c = Container()
        c.register({ return Fruit(c.resolve()!)})
        c.register({ return StringContainer(c.resolve()!)})
        c.register({ return Basket(c.resolve()!, number: c.resolve()!)})
        c.register({ return "Banana"})
        c.register({ return 12})
        

        XCTAssertTrue(s.contains("String"))
    }
    
    private struct Basket {
        let fruit: Fruit
        let number: Int
    }
    
    private class Fruit {
