def rename(rename_map)
      @by_id.each.with_index do |klass, id|
        # Some entries can be nil. Ignore them.
        next unless klass

        if (new_name = rename_map[klass])
          # We have a rename request. Update the current @by_id entry.
          @by_id[id] = new_name
          # Remove the old class name from @by_class hash.
          @by_class.delete(klass)
          # Insert the new one with the current ID.
          @by_class[new_name] = id
        end
      end
    end
def rename(rename_map)
      @by_id.each.with_index do |klass, id|
        # Some entries can be nil. Ignore them.
        next unless klass

        if (new_name = rename_map[klass])
          # We have a rename request. Update the current @by_id entry.
          @by_id[id] = new_name
          # Remove the old class name from @by_class hash.
          @by_class.delete(klass)
          # Insert the new one with the current ID.
          @by_class[new_name] = id
        end
      end
    end
Rename a set of classes to new names.
 @param rename_map [Hash] Hash that maps old names to new names