function assertEqualsCallback(msg, expected) {
  return function(res) {
    assertEquals(msg, expected, res);
    // Since the assertion is an exception that will be caught inside the
    // Deferred object, we must advance the clock to see if it has failed.
    mockClock.tick();
    return res;
  };
}
@param {string} msg Message to show upon failure.
@param {T} expected Expected value.
@return {function(T): T} Function to be called with the actual value that
    will assert that it is equal to the expected value.
@template T