code: function safeRestoreStub(obj) {
      if (obj && 'restore' in obj && _.isFunction(obj.restore)) {
          obj.restore();
      }
  }
docs: Safely to restore the stub
  if it is a stub then call the restore(); if not, do nothing
  @param {Object} obj - The input object want to restore stub