anchor.diff:    E0 register<E0 extends E>(E0 entity) {
       assert(
           !_closed, "Trying to register $entity @ ${_list.length} when closed.");
  -    assert(entity != null);
  -    assert(entity._index == null);
  +    assert((entity as dynamic) != null); // TODO(48820): Remove.
       entity._index = _list.length;
       _list.add(entity);
       _size++;
  
positive.code:   bool _closed = false;
  
    int _size = 0;
    final List<E> _list = <E>[];
  
    /// Returns the [index]th entity in the map.
    E getEntity(int index) => _list[index];
  
    /// Returns the number of non-null entities in the map.
    int get size => _size;
  
negative.code: // for details. All rights reserved. Use of this source code is governed by a
  // BSD-style license that can be found in the LICENSE file.
  
  /// Indexed entity interfaces for modeling elements derived from Kernel IR.
  
  import '../elements/entities.dart';
  
  abstract class _Indexed {
    late final int _index;
  }
  
  abstract class IndexedLibrary extends _Indexed implements LibraryEntity {
  