         XCTAssertNotNil(response?.data)
         XCTAssertEqual(response?.result.isFailure, true)
 
-        if #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) {
-            XCTAssertNotNil(response?.metrics)
+        var metrics: AnyObject? = nil
+        if #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) {
+            metrics = response?.metrics
+            XCTAssertNotNil(metrics)
         }
     }
 }

        XCTAssertNotNil(response?.data)
        XCTAssertEqual(response?.result.isSuccess, true)

        if #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) {
            XCTAssertNotNil(response?.metrics)
        }
    }


            XCTFail("flatMap should catch the transformation error")
        }

        var metrics: AnyObject? = nil
        if #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) {
            metrics = response?.metrics
            XCTAssertNotNil(metrics)
        }
    }

