anchor.diff:    void printMetrics() {
       print('');
       print('Node classes by context');
  -    _printContextMap(data.byNodeClass, (className) => className);
  +    _printContextMap(data.byNodeClass);
       print('');
       print('Element kinds by context');
  -    _printContextMap(data.byElementKind, (kind) => kind.name);
  +    _printContextMap(data.byElementKind);
       print('');
       print('Token types by context');
  -    _printContextMap(data.byTokenType, (type) => type.name);
  +    _printContextMap(data.byTokenType);
       print('');
       print('Argument types match');
  -    _printContextMap(data.byTypeMatch, (match) => match.toString());
  +    _printContextMap(data.byTypeMatch);
       print('');
       print('Distance from reference to declaration');
  -    _printContextMap(data.byDistance, (distance) => distance.toString());
  +    _printContextMap(data.byDistance);
     }
   
     /// Print a [contextMap] containing one kind of metric data, using the
     /// [getName] function to print the second-level keys.
  -  void _printContextMap<T>(
  -      Map<String, Map<T, int>> contextMap, String Function(T) getName) {
  +  void _printContextMap(Map<String, Map<String, int>> contextMap) {
       var contexts = contextMap.keys.toList()..sort();
       for (var context in contexts) {
         var kindMap = contextMap[context];
  
positive.code:         if (percent.length < 4) {
            percent = ' $percent';
          }
          print('    $percent%: ${getName(entry.key)} ($value)');
        }
      }
    }
  
negative.code: 
    /// Decode the content of the [source] map into the [target] map, using the
    /// [keyMapper] to map the inner keys from a string to a [T].
    void _decodeMap(
        Map<String, Map<String, int>> target, Map<String, dynamic> source) {
      var outerMap = _convert(source);
      for (var outerEntry in outerMap.entries) {
        var outerKey = outerEntry.key;
        var innerMap = _convert(outerEntry.value);
        for (var innerEntry in innerMap.entries) {
          var innerKey = innerEntry.key;
          var count = innerEntry.value as int;
          target.putIfAbsent(outerKey, () => {})[innerKey] = count;
        }
      }
    }
  
    /// Initialize the state of this object from the given JSON encoded [content].
    void _initializeFromJson(String content) {
      var contentObject = _convert(json.decode(content));
      var version = contentObject['version'].toString();
      if (version != currentVersion) {
        throw StateError(
            'Invalid version: expected $currentVersion, found $version');
      }
      _decodeMap(byDistance, contentObject['byDistance']);
      _decodeMap(byElementKind, contentObject['byElementKind']);
      _decodeMap(byNodeClass, contentObject['byNodeClass']);
      _decodeMap(byTokenType, contentObject['byTokenType']);
      _decodeMap(byTypeMatch, contentObject['byTypeMatch']);
    }
  }
  
  