anchor.diff:    test('conflicting transitions', () {
       var controller = new StreamController.broadcast(sync: true);
   
  -    var machine = new Machine();
  +    try {
  +      var machine = new Machine();
   
  -    var stateA = machine.newState('a');
  -    var stateB = machine.newState('b');
  -    var stateC = machine.newState('c');
  +      var stateA = machine.newState('a');
  +      var stateB = machine.newState('b');
  +      var stateC = machine.newState('c');
   
  -    stateA.onStream(controller.stream, (value) => stateB.enter());
  -    stateA.onStream(controller.stream, (value) => stateC.enter());
  +      stateA.onStream(controller.stream, (value) => stateB.enter());
  +      stateA.onStream(controller.stream, (value) => stateC.enter());
   
  -    machine.start();
  -    controller.add('*');
  -    expect(machine.current, stateB);
  +      machine.start();
  +      controller.add('*');
  +      expect(machine.current, stateB);
  +    } finally {
  +      controller.close();
  +    }
     });
     test('future transitions', () {
       var machine = new Machine();
  
positive.code:     var log = new List();
      var inner = new Machine();
      inner.newState('a')
          ..onEntry(() => log.add('inner entry a'))
          ..onExit(() => log.add('inner exit a'));
      var outer = new Machine();
      outer.newState('a')
          ..onEntry(() => log.add('outer entry a'))
          ..onExit(() => log.add('outer exit a'))
          ..addNested(inner);
      outer.start();
      expect(log, ['outer entry a', 'inner entry a']);
      outer.stop();
      expect(log, ['outer entry a', 'inner entry a', 'outer exit a', 'inner exit a']);
    });
  }
  
negative.code:     var stateB = machine.newState('b');
      var stateC = machine.newState('c');
  
      stateA.onTimeout(new Duration(milliseconds: 10), expectAsync0(() {
        expect(machine.current, stateA);
        stateB.enter();
      }));
      stateA.onTimeout(
          new Duration(milliseconds: 20), () => fail('should never be called'));
      stateB.onTimeout(
          new Duration(milliseconds: 20), () => fail('should never be called'));
      stateB.onTimeout(new Duration(milliseconds: 10), expectAsync0(() {
        expect(machine.current, stateB);
        stateC.enter();
      }));
  
      machine.start();
    });
  