anchor.diff:      }
     }
   
  -  bool _checkConflict(_TrielikePackageTreeHelper currentMapHelper,
  +  bool _checkConflict(_PackageTrieNode currentTrieNode,
         SimplePackage newPackage, void Function(Object error) onError) {
  -    if (currentMapHelper.package != null) {
  -      var existingPackage = currentMapHelper.package!;
  +    if (currentTrieNode.package != null) {
  +      var existingPackage = currentTrieNode.package!;
         // Trying to add package that is inside the existing package.
         // 1) If it's an exact match it's not allowed (i.e. the roots can't be
         //    the same).
  
positive.code:   /// The packages are added in order of their root path.
    void add(SimplePackage newPackage, void Function(Object error) onError) {
      var root = newPackage.root;
      var currentMapHelper = _map[root.scheme] ??= _TrielikePackageTreeHelper();
      if (_checkConflict(currentMapHelper, newPackage, onError)) return;
      var segments = root.pathSegments;
      for (var i = 0; i < segments.length - 1; i++) {
        var path = segments[i];
        currentMapHelper =
            currentMapHelper.map[path] ??= _TrielikePackageTreeHelper();
        if (_checkConflict(currentMapHelper, newPackage, onError)) return;
      }
      currentMapHelper.package = newPackage;
      _packages.add(newPackage);
    }
  
    bool _isMatch(String path, _TrielikePackageTreeHelper currentMapHelper,
        List<SimplePackage> potential) {
      if (currentMapHelper.package != null) {
        var currentPackage = currentMapHelper.package!;
        var currentPackageRootLength = currentPackage.root.toString().length;
        if (path.length == currentPackageRootLength) return true;
        var currentPackageUriRoot = currentPackage.packageUriRoot.toString();
  
negative.code: 
    @override
    SimplePackage? packageOf(Uri file) {
      var currentTrieNode = _map[file.scheme];
      if (currentTrieNode == null) return null;
      var path = file.toString();
      var potential = <SimplePackage>[];
      if (_isMatch(path, currentTrieNode, potential)) {
        return currentTrieNode.package;
      }
      var segments = file.pathSegments;
  
      for (var i = 0; i < segments.length - 1; i++) {
        var segment = segments[i];
        currentTrieNode = currentTrieNode!.map[segment];
        if (currentTrieNode == null) break;
        if (_isMatch(path, currentTrieNode, potential)) {
          return currentTrieNode.package;
        }
      }
      if (potential.isEmpty) return null;
  