   
   func testUnknownCacheKeyReturnsNoImage() {
     let expectation = self.expectation(description: "Retrieve no image from cache")
-    cache = Cache.default
+    let cache = Cache.default
     let image = helper.image
     
-    cache.store(image, forKey: "key1") { [cache] in
-      cache!.retrieveImage(forKey: "key2") { image, type in
+    cache.store(image, forKey: "key1") {
+      cache.retrieveImage(forKey: "key2") { image, type in
         XCTAssertNil(image)
         XCTAssertEqual(type, .none)
         expectation.fulfill()


  func testCacheWithIdentifierIsCachedAsSeparateImage() {
    let expectation = self.expectation(description: "Retrieve image from cache")
    cache = Cache.default
    let image = helper.image
    let alternateImage = UIImage(data: image.jpegData(compressionQuality: 0.2)!)!
    let key = #function
    let transformerId = "transformer"

    cache.store(image, forKey: key) { [cache] in
      cache!.store(alternateImage, forKey: key, transformerId: transformerId) {
        cache!.retrieveImage(forKey: key) { image, _ in
          cache!.retrieveImage(forKey: key, transformerId: transformerId) { transformerImage, _ in
            XCTAssertNotNil(image)
            XCTAssertNotNil(transformerImage)
            XCTAssertNotEqual(image, transformerImage)

  
  func testItStoresImagesToDisk() {
    let expectation = self.expectation(description: "Retrieve image from cache")
    let cache = Cache.default
    let image = helper.image
    let key = #function
    
    cache.store(image, forKey: key) {
      cache.clearMemory()
      cache.retrieveImage(forKey: key) { image, type in
        XCTAssertNotNil(image)
        XCTAssertEqual(type, .disk)
        expectation.fulfill()
