anchor.diff:  library observe.src.microtask;
   
   import 'dart:async' show Completer, runZonedExperimental;
  +import 'dart:collection';
   import 'package:observe/observe.dart' show Observable;
   
   // TODO(jmesserly): remove "microtask" from these names and instead import
  
positive.code:   }
  }
  
  List<Function> _pending = [];
  
  /**
   * Wraps the [testCase] in a zone that supports [performMicrotaskCheckpoint],
   * and returns the test case.
   */
  wrapMicrotask(testCase()) {
    return () {
      return runZonedExperimental(() {
        try {
          return testCase();
        } finally {
          performMicrotaskCheckpoint();
        }
      }, onRunAsync: (callback) => _pending.add(callback));
    };
  }
  
negative.code:  * performing [Observable.dirtyCheck], until there are no more pending events.
   * It will always dirty check at least once.
   */
  // TODO(jmesserly): do we want to support nested microtasks similar to nested
  // zones? Instead of a single pending list we'd need one per wrapMicrotask,
  // and [performMicrotaskCheckpoint] would only run pending callbacks
  // corresponding to the innermost wrapMicrotask body.
  void performMicrotaskCheckpoint() {
    Observable.dirtyCheck();
  
    while (_pending.isNotEmpty) {
  
      for (int len = _pending.length; len > 0 && _pending.isNotEmpty; len--) {
        final callback = _pending.removeFirst();
        try {
          callback();
        } catch (e, s) {
  