         XCTAssertEqual(xs.subscriptions, [
             Subscription(200, 400)])
     }
-    
+
+    #if TRACE_RESOURCES
+        func testGroupByReleasesResourcesOnComplete() {
+            _ = Observable<Int>.just(1).groupBy { $0 }.subscribe()
+        }
+
+        func testGroupByReleasesResourcesOnError1() {
+            _ = Observable<Int>.error(testError).groupBy { $0 }.subscribe()
+        }
+
+        func testGroupByReleasesResourcesOnError2() {
+            _ = Observable<Int>.error(testError).groupBy { x -> Int in throw testError }.subscribe()
+        }
+    #endif
 }
 
 extension String {

        })

    }
    
}

// groupBy

            Subscription(200, 350)
            ])
    }

    #if TRACE_RESOURCES
        func testSkipWhileReleasesResourcesOnComplete() {
            _ = Observable<Int>.just(1).skipWhile { _ in true }.subscribe()
        }

        func testSkipWhileReleasesResourcesOnError() {
            _ = Observable<Int>.error(testError).skipWhile { _ in true }.subscribe()
        }

        func testSkipWhileWithIndexReleasesResourcesOnComplete() {
            _ = Observable<Int>.just(1).skipWhileWithIndex { _ in true }.subscribe()
        }

        func testSkipWhileWithIndexReleasesResourcesOnError() {
            _ = Observable<Int>.error(testError).skipWhileWithIndex { _ in true }.subscribe()
        }
    #endif
}

// MARK: elementAt
