     @Published var value = "obj2"
 }
 
-private class ExternalState3: ObservableObject {
-    @Published var value = "obj3"
+private struct EnvironmentParameter {
+    let state = CurrentValueSubject<String, Never>("obj3")
+}
+
+extension EnvironmentParameter {
+    struct EnvKey: EnvironmentKey {
+        let state: EnvironmentParameter
+        static var defaultValue: Self { .init(state: EnvironmentParameter()) }
+    }
+}
+
+extension EnvironmentValues {
+    fileprivate var state3: EnvironmentParameter.EnvKey {
+        get { self[EnvironmentParameter.EnvKey.self] }
+        set { self[EnvironmentParameter.EnvKey.self] = newValue }
+    }
 }
 
 extension ViewType {

    }
    
    func testEnvironmentStateChanges3() throws {
        let object1 = ExternalState1(), object2 = ExternalState2(), object3 = ExternalState3()
        let view = EnvironmentStateTestView3()
        let text1 = try view.inspect(object1, object2, object3).text().string()
        XCTAssertEqual(text1, "obj1obj2obj3")
        object3.value = "abc"
        let text2 = try view.inspect(object1, object2, object3).text().string()
        XCTAssertEqual(text2, "obj1obj2abc")
    }

import XCTest
import Combine
import SwiftUI

@testable import ViewInspector
