code: function (methodId) {                                                               // 987
      var self = this;                                                                                              // 988
      if (self._documentsWrittenByStub[methodId])                                                                   // 989
        throw new Error("Duplicate methodId in _retrieveAndStoreOriginals");                                        // 990
                                                                                                                    // 991
      var docsWritten = [];                                                                                         // 992
      _.each(self._stores, function (s, collection) {                                                               // 993
        var originals = s.retrieveOriginals();                                                                      // 994
        // not all stores define retrieveOriginals                                                                  // 995
        if (!originals)                                                                                             // 996
          return;                                                                                                   // 997
        originals.forEach(function (doc, id) {                                                                      // 998
          docsWritten.push({collection: collection, id: id});                                                       // 999
          if (!_.has(self._serverDocuments, collection))                                                            // 1000
            self._serverDocuments[collection] = new MongoIDMap;                                                     // 1001
          var serverDoc = self._serverDocuments[collection].setDefault(id, {});                                     // 1002
          if (serverDoc.writtenByStubs) {                                                                           // 1003
            // We're not the first stub to write this doc. Just add our method ID                                   // 1004
            // to the record.                                                                                       // 1005
            serverDoc.writtenByStubs[methodId] = true;                                                              // 1006
          } else {                                                                                                  // 1007
            // First stub! Save the original value and our method ID.                                               // 1008
            serverDoc.document = doc;                                                                               // 1009
            serverDoc.flushCallbacks = [];                                                                          // 1010
            serverDoc.writtenByStubs = {};                                                                          // 1011
            serverDoc.writtenByStubs[methodId] = true;                                                              // 1012
          }                                                                                                         // 1013
        });                                                                                                         // 1014
      });                                                                                                           // 1015
      if (!_.isEmpty(docsWritten)) {                                                                                // 1016
        self._documentsWrittenByStub[methodId] = docsWritten;                                                       // 1017
      }                                                                                                             // 1018
    }
docs: 983 Retrieves the original versions of all documents modified by the stub for                                    // 984 method 'methodId' from all stores and saves them to _serverDocuments (keyed                                  // 985 by document) and _documentsWrittenByStub (keyed by method ID).                                               // 986