docs: public static Map<String, Object> revisionHistoryToJson(List<InternalDocumentRevision> history,
                                                              Map<String, ? extends Attachment> attachments,
                                                              boolean shouldInline,
                                                              int minRevPos) {
          Misc.checkNotNull(history, "History");
          Misc.checkArgument(history.size() > 0, "History must have at least one DocumentRevision.");
          Misc.checkArgument(checkHistoryIsInDescendingOrder(history),
                  "History must be in descending order.");
  
          InternalDocumentRevision currentNode = history.get(0);
  
          Map<String, Object> m = currentNode.asMap();
          if (attachments != null && !attachments.isEmpty()) {
              // graft attachments on to m for this particular revision here
              addAttachments(attachments, m, shouldInline, minRevPos);
          }
  
          m.put(CouchConstants._revisions, createRevisions(history));
  
          return m;
      }