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

        button.imageObserver = {
            disabledStateBackgroundImageDownloadComplete = true
            expectation4.fulfill()
        } as (() -> Void)

        waitForExpectations(timeout: timeout, handler: nil)


        button.imageObserver = {
            selectedStateImageDownloadComplete = true
            expectation2.fulfill()
        }

        waitForExpectations(timeout: timeout, handler: nil)

