class Subject ext ProxifiedObject {
  Integer attr
  Observer obs

  void doSomething(Dummy x) {
    this.attr := 25;
  }
  void changed (Dummy x) {
    this.obs.update(this)
  }
  void setObserver (Observer x) {
    this.obs := x
  }
}

class Observer ext ProxifiedObject {
  void update (Subject x) {
    out.println(x.attr)
  }
}

class X ext ProxifiedObject {
  Subject s
  Observer o

  void main(X x) {
    x.s := new Subject;
    x.o := new Observer;
    x.s.setObserver(x.o);
    x.s.doSomething(x);
    x.s.changed(x);
  }
}
