anchor.diff:              listener(key, widget);
           }
         }
  -
         for (GlobalKey key in _removedKeys) {
           if (!_registry.containsKey(key) && _removeListeners.containsKey(key)) {
             Set<GlobalKeyRemoveListener> localListeners = new Set<GlobalKeyRemoveListener>.from(_removeListeners[key]);
  
positive.code: 
    // Returns the child which should be retained as the child of this node.
    Widget syncChild(Widget newNode, Widget oldNode, dynamic slot) {
  
      if (newNode == oldNode) {
        // TODO(ianh): Simplify next few asserts once the analyzer is cleverer
        assert(newNode is! RenderObjectWrapper ||
               (newNode is RenderObjectWrapper && newNode._ancestor != null)); // if the child didn't change, it had better be configured
        assert(newNode is! StatefulComponent ||
               (newNode is StatefulComponent && newNode._isStateInitialized)); // if the child didn't change, it had better be configured
        if (newNode != null) {
          newNode.setParent(this);
          newNode._markAsFromCurrentGeneration();
        }
        return newNode; // Nothing to do. Subtrees must be identical.
      }
  
      assert(() {
        'You have probably used a single instance of a Widget in two different places in the widget tree. Widgets can only be used in one place at a time.';
        return newNode == null || newNode.isFromOldGeneration;
      });
  
      if (oldNode != null && !oldNode.isFromOldGeneration)
        oldNode = null;
  
      if (newNode == null) {
        // the child in this slot has gone away
        // remove it if they old one is still here
        if (oldNode != null) {
          assert(oldNode != null);
          assert(oldNode.isFromOldGeneration);
          assert(oldNode.mounted);
          oldNode.detachRenderObject();
          oldNode.remove();
          assert(!oldNode.mounted);
          // we don't update the generation of oldNode, because there's
          // still a chance it could be reused as-is later in the tree.
        }
        return null;
      }
  
      if (oldNode != null) {
        assert(newNode != null);
        assert(newNode.isFromOldGeneration);
        assert(oldNode.isFromOldGeneration);
        if (!Widget._canSync(newNode, oldNode)) {
          assert(oldNode.mounted);
          // We want to handle the case where there is a removal of zero
          // or more widgets. In this case, we should be able to sync
          // ourselves with a Widget that is a descendant of the
          // oldNode, skipping the nodes in between. Let's try that.
          Widget deadNode = oldNode;
          Widget candidate = _getCandidateSingleChildFrom(oldNode);
          oldNode = null;
  
          while (candidate != null) {
            if (Widget._canSync(newNode, candidate)) {
              assert(candidate.parent != null);
              assert(candidate.parent.singleChild == candidate);
              if (candidate.renderObject != deadNode.renderObject) {
                // TODO(ianh): Handle removal across RenderNode boundaries
              } else {
                candidate.parent.takeChild();
                oldNode = candidate;
              }
              break;
            }
            candidate = _getCandidateSingleChildFrom(candidate);
          }
  
          // TODO(ianh): Handle insertion, too...
  
          if (oldNode == null)
            deadNode.detachRenderObject();
          deadNode.remove();
        }
        if (oldNode != null) {
          assert(newNode.isFromOldGeneration);
          assert(oldNode.isFromOldGeneration);
          assert(Widget._canSync(newNode, oldNode));
          if (oldNode.retainStatefulNodeIfPossible(newNode)) {
            assert(oldNode.mounted);
            assert(!newNode.mounted);
            oldNode.setParent(this);
            oldNode._sync(newNode, slot);
            assert(oldNode.renderObject is RenderObject);
            return oldNode;
          } else {
            oldNode.setParent(null);
          }
        }
      }
  
      assert(oldNode == null || (oldNode.mounted == false && oldNode.parent == null));
      newNode.setParent(this);
      newNode._sync(oldNode, slot);
      assert(newNode.renderObject is RenderObject);
      return newNode;
    }
  
    String _adjustPrefixWithParentCheck(Widget child, String prefix) {
  
negative.code:       nextPrefix = prefix + '   ';
        childrenString += lastChild.toString(nextPrefix, _adjustPrefixWithParentCheck(lastChild, nextStartPrefix));
      }
      return '$startPrefix${toStringName()}\n$childrenString';
    }
    String toStringName() {
      List<String> details = <String>[];
      debugAddDetails(details);
      String detailString = details.join('; ');
      return '$runtimeType($detailString})';
    }
    void debugAddDetails(List<String> details) {
      if (key != null)
        details.add('$key');
      details.add('hashCode=$hashCode');
      details.add(mounted ? 'mounted' : 'not mounted');
      String generationString = '';
      if (_generation != _currentGeneration) {
        int delta = _generation - _currentGeneration;
        String sign = delta < 0 ? '' : '+';
        details.add('gen$sign$delta');
      }
    }
  
    // This function can be safely called when the layout is valid.
  