protected internal virtual void PrepareIndexAndSnapshots(SnapshotDeletionPolicy sdp, IndexWriter writer, int numSnapshots) { for (int i = 0; i < numSnapshots; i++) { // create dummy document to trigger commit. writer.AddDocument(new Document()); writer.Commit(); Snapshots.Add(sdp.Snapshot()); } }