     }
     
     func testEnvironmentStateChanges1() throws {
-        var sut = EnvironmentStateTestView()
-        let viewModel = ExternalState()
-        let exp = sut.on(\.didAppear) { view in
-            let text1 = try view.inspect().text().string()
+        let sut = EnvironmentStateTestView()
+        let viewModel = ExternalState()
+        let exp = sut.inspection.inspect { view in
+            let text1 = try view.text().string()
             XCTAssertEqual(text1, "obj1")
             viewModel.value = "abc"
-            let text2 = try view.inspect().text().string()
+            let text2 = try view.text().string()
             XCTAssertEqual(text2, "abc")
         }
         ViewHosting.host(view: sut.environmentObject(viewModel))

        wait(for: [exp], timeout: 0.1)
    }
    
    func testManualCallbackConfiguration() throws {
        var sut = LocalStateTestView(flag: false)
        let exp = XCTestExpectation(description: "didAppear")
        sut.didAppear = { view in
            view.inspect { content in
                XCTAssertFalse(try content.actualView().flag)
                try content.button().tap()
                XCTAssertTrue(try content.actualView().flag)
                ViewHosting.expel()
                exp.fulfill()
            }
        }
        ViewHosting.host(view: sut)
        wait(for: [exp], timeout: 0.1)
    }
    
    func testLocalStateChangesOnMirror() throws {
        var sut = LocalStateTestView(flag: false)
        let exp = sut.on(\.didAppear) { view in
            let mirror = try view.inspect()
            let text1 = try mirror.button().text().string()
            XCTAssertEqual(text1, "false")
            try mirror.button().tap()
            let text2 = try mirror.button().text().string()
            XCTAssertEqual(text2, "true")
        }
        ViewHosting.host(view: sut)
        wait(for: [exp], timeout: 0.1)
    }
    
    func testStateMutationOnPublisherUpdate() throws {
        var sut = LocalStateTestView(flag: false)
        let exp = sut.on(\.didReceiveValue) { view in
            XCTAssertTrue(view.flag)
            let text = try view.inspect().button().text().string()
            XCTAssertEqual(text, "true")
        }
        ViewHosting.host(view: sut)
        sut.publisher.send(true)
        wait(for: [exp], timeout: 0.1)
    }
    
    func testViewWithInspection() throws {
        let sut = TestViewWithInspection(flag: false)
        let exp1 = sut.inspection.inspect { view in
            XCTAssertFalse(try view.actualView().flag)
            try view.button().tap()
        }
        let exp2 = sut.inspection.inspect(after: 0.1) { view in
            XCTAssertTrue(try view.actualView().flag)
        }
        ViewHosting.host(view: sut)
        wait(for: [exp1, exp2], timeout: 0.2)

}

private class Inspection<V>: InspectionEmissary where V: View & Inspectable {
    let notice = PassthroughSubject<UInt, Never>()
    var callbacks = [UInt: (V) -> Void]()
    
    func visit(_ view: V, _ line: UInt) {
        if let callback = callbacks.removeValue(forKey: line) {
