 
         waitForExpectations(timeout: 2) { error in
             XCTAssertNil(error)
-            XCTAssert(isMainQueue)
+            XCTAssertEqual(isMainQueue, true)
         }
     }
 

        subject.subscribe(onNext: { string in
            received.append(string)
        }, onError: { error in
            receivedError = error
            exp.fulfill()
        })

        observable.on(.next("1"))
        observable.on(.error(TestError.test))

        waitForExpectations(timeout: 1) { _ in
            XCTAssert(received.count == 1)
            XCTAssert(received.first == "1")
            XCTAssertEqual(receivedError as? TestError, TestError.test)
        }
    }

    func testForwardDone() {
        let exp = expectation(description: "forward")

        var received: [String] = []

        let subject = Observable<String>()
        let observable = Observable<String>()
        observable.forward(to: subject)

        subject.subscribe(onNext: { string in
            received.append(string)
        }, onDone: {
            exp.fulfill()
        })

        observable.on(.next("1"))
        observable.on(.done)

        waitForExpectations(timeout: 1) { _ in
            XCTAssert(received.count == 1)
            XCTAssert(received.first == "1")
        }
    }

    func testMerge() {
        let exp = expectation(description: "merge")

        var received: [String] = []

        let a = Observable<String>()
        let b = Observable<String>()

        let subject = Observable.merge([a, b])

        subject.subscribe(onNext: { string in
            received.append(string)
        }, onDone: {
            exp.fulfill()
        })

        a.on(.next("1"))
        b.on(.next("2"))
        b.on(.done)

        waitForExpectations(timeout: 1) { _ in
            XCTAssert(received.count == 2)
            XCTAssert(received.first == "1")
            XCTAssert(received.last == "2")
        }
    }

    func testCombineLatestNonOptional() {
        let exp = expectation(description: "combineLatest")

        var received: [String] = []

        let string = Observable<String>()

        observable.on(.next("1"))

        waitForExpectations(timeout: 1) { _ in
            XCTAssertEqual(received.count, 1)
            XCTAssertEqual(received.first, "3")
        }
    }

