function assertRetainsReference(/** !Object */ object, /** * */ value) {
  const path = searchForReference(object, value);
  if (!path) {
    asserts.raiseException(
        `The object does not transitively retain a reference to the given value`);
  }
}
Asserts that the given object has a transitive reference on the given value.

This may be useful when writing tests to confirm that certain values'leaked'.