     for i in 0 ..< max {
       (image, result) = cache.perform(urls[i])
       XCTAssert(result != .MemoryHit, "Pass")
-      XCTAssert(image!.size.width == 200 && image!.size.height == 200 , "Pass")
-    }
-    for i in 0 ..< max {
-      (image, result) = cache.perform(urls[i])
-      XCTAssert(result == .MemoryHit, "Pass")
-      XCTAssert(image!.size.width == 200 && image!.size.height == 200 , "Pass")
+      check(image)
+    }
+    for i in 0 ..< max {
+      (image, result) = cache.perform(urls[i])
+      XCTAssert(result == .MemoryHit, "Pass")
+      check(image)
     }
     for i in max ..< max + 5 {
       (image, result) = cache.perform(urls[i])
       XCTAssert(result != .MemoryHit, "Pass")
-      XCTAssert(image!.size.width == 200 && image!.size.height == 200 , "Pass")
-    }
-    for i in 0 ..< max {
-      (image, result) = cache.perform(urls[i])
-      XCTAssert(result != .MemoryHit, "Pass")
-      XCTAssert(image!.size.width == 200 && image!.size.height == 200 , "Pass")
-    }
-    for i in 0 ..< max {
-      (image, result) = cache.perform(urls[i])
-      XCTAssert(result == .MemoryHit, "Pass")
-      XCTAssert(image!.size.width == 200 && image!.size.height == 200 , "Pass")
+      check(image)
+    }
+    for i in 0 ..< max {
+      (image, result) = cache.perform(urls[i])
+      XCTAssert(result != .MemoryHit, "Pass")
+      check(image)
+    }
+    for i in 0 ..< max {
+      (image, result) = cache.perform(urls[i])
+      XCTAssert(result == .MemoryHit, "Pass")
+      check(image)
     }
     for i in max ..< max + 5 {
       (image, result) = cache.perform(urls[i])
       XCTAssert(result != .MemoryHit, "Pass")
-      XCTAssert(image!.size.width == 200 && image!.size.height == 200 , "Pass")
+      check(image)
     }
   }
 

    for i in 0 ..< max {
      (image, result) = cache1.perform(urls[i])
      XCTAssert(result != .MemoryHit, "Pass")
      XCTAssert(image!.size.width == 200 && image!.size.height == 200 , "Pass")
    }
    for i in 0 ..< max {
      (image, result) = cache2.perform(urls[i])
      XCTAssert(result == .MemoryHit, "Pass")
      XCTAssert(image!.size.width == 200 && image!.size.height == 200 , "Pass")
    }
  }
  

    for i in 0 ..< max / 2 {
      (image, result) = cache.perform(urls[i])
      XCTAssert(result != .MemoryHit, "Pass")
      check(image)
    }
    for i in 0 ..< max / 2 {
      (image, result) = cache.perform(urls[i])
      XCTAssert(result == .MemoryHit, "Pass")
      check(image)
    }
    for i in max / 2 ..< max {
      (image, result) = cache.perform(urls[i])
      XCTAssert(result != .MemoryHit, "Pass")
      check(image)
    }
  }

