code: function (events, aggregateModel, notSameOrigin) {
      if (!events) {
        return;
      }
  
      if (!_.isArray(events)) {
        events = [events];
      }
  
      var self = this;
  
      events.forEach(function (evt) {
        var evtName = dotty.get(evt, self.definitions.event.name);
        if (!evtName) {
          var err = new Error('event has no event name in ' + self.definitions.event.name);
          debug(err);
          throw err;
        }
  
        var version = 0;
        if (!!self.definitions.event.version) {
          version = dotty.get(evt, self.definitions.event.version);
        }
  
        var event = self.getEvent(evtName, version);
  
        if (!event) {
          if (notSameOrigin) {
            debug('You don\'t want to handle event "' + evtName + '" of other event stream');
            return;
          }
          var err = new Error('Event "' + evtName + '" not found!');
          debug(err);
          throw err;
        }
  
        event.apply(evt, aggregateModel);
      });
    }
docs: Applies the passed events to the passed aggregateModel.
  @param {Array || Object} events         The events that should be applied.
  @param {AggregateModel}  aggregateModel The aggregateModel that should be used.
  @param {boolean}         notSameOrigin  If true it's an indication to not throw if event handler not found.