public void testEventPropagation() {
    class IntSetVarValueObserver extends Observer {
      int counter = 0;

      @Override
      public Object master() {
        return this;
      }

      @Override
      public int subscriberMask() {
        return IntSetEventConstants.VALUE;
      }

      @Override
      public void update(Subject var, EventOfInterest ev) throws Failure {
        // IntSetVar.IntSetEvent e = (IntSetVar.IntSetEvent)ev;

        System.out.println("value#" + counter + " obtained: " + ((IntSetVar) var).value());
        counter++;
      }
    }

    IntSetVar var1 = C.addIntSetVar(new int[] {1, 2, 3, 4, 5, 6, 7});
    var1.attachObserver(new IntSetVarValueObserver());
    IntSetVar var2 = C.addIntSetVar(new int[] {5, 6, 7, 8, 9, 10, 11});
    IntSetVar var3 = C.addIntSetVar(new int[] {28, 78, 23, 1, 4, 7});

    IntSetVarArray array = new IntSetVarArray(C, 1);
    array.set(var1, 0);

    Goal generate = new GoalIntSetGenerate(array);

    IntExp intersectionWithVar2 = var1.intersectionWith(var2).cardinality();
    IntExp intersectionWithVar3 = var1.intersectionWith(var3).cardinality();

    Goal alt1 = new GoalMinimize(generate, intersectionWithVar2.neg());
    Goal alt2 = new GoalMinimize(generate, intersectionWithVar3.neg());

    alt1 = new GoalAnd(alt1, new GoalFail(C));

    Goal main = new GoalOr(alt1, alt2);
    C.execute(main);
    System.out.println("Succeeded");
  }