 
     var delegate: Delegate!
 
-    init(parent: FakeState) {
+    public init(parent: FakeState) {
         self.parent = parent
         processId = 0
         element = EmittingTestApplicationElement()

public class FakeWindowBuilder {
    private let w: FakeWindow

    init(parent: FakeApplication) {
        w = FakeWindow(parent: parent)
    }

    func setTitle(_ title: String) -> FakeWindowBuilder { w.title = title; return self }
    func setRect(_ rect: CGRect) -> FakeWindowBuilder { w.rect = rect; return self }
    func setPosition(_ pos: CGPoint) -> FakeWindowBuilder { w.rect.origin = pos; return self }
    func setSize(_ size: CGSize) -> FakeWindowBuilder { w.rect.size = size; return self }
    func setMinimized(_ isMinimized: Bool = true) -> FakeWindowBuilder {
        w.isMinimized = isMinimized
        return self
    }
    func setFullscreen(_ isFullscreen: Bool = true) -> FakeWindowBuilder {
        w.isFullscreen = isFullscreen
        return self
    }

    func build() -> Promise<FakeWindow> {
        // TODO schedule new window event
        //w.parent.delegate!...
        return w.parent.delegate.addWindowElement(w.element).then { delegate -> FakeWindow in

    var state: State
    var appObserver: FakeApplicationObserver

    public init() {
        appObserver = FakeApplicationObserver()
        delegate = Delegate(appObserver: appObserver)
        state = State(delegate: delegate)
