class DocumentSet implements Iterable<Document> {

  public List<Document> toList() {
    List<Document> documents = new ArrayList<>(size());
    for (Document document : this) {
      documents.add(document);
    }
    return documents;
  }

  private  DocumentSet(
      ImmutableSortedMap<DocumentKey, Document> keyIndex, ImmutableSortedSet<Document> sortedSet);

}