         button.imageObserver = {
             normalStateImageDownloadComplete = true
             expectation1.fulfill()
-        } as (() -> Void)
+        }
 
         waitForExpectations(timeout: timeout, handler: nil)
 

            imageDownloadComplete = true
            finalImageEqualsPlaceholderImage = button.image(for:[]) === placeholderImage
            expectation.fulfill()
        } as (() -> Void)

        waitForExpectations(timeout: timeout, handler: nil)


        button.imageObserver = {
            disabledStateBackgroundImageDownloadComplete = true
            expectation4.fulfill()
        }

        waitForExpectations(timeout: timeout, handler: nil)

