{
ArrayList<Document> smallDocs = MemTimeBenchmark.documents;
ArrayList<Document> largeDocs = new ArrayList<Document>();
final int MERGE_DOCS = 5;
Document last = null;
for (int i = 0; i < smallDocs.size(); i++)
{
if ((i % MERGE_DOCS) == 0)
{
largeDocs.add(last = new Document());
}
Document d = smallDocs.get(i);
last.setTitle(join(last.getTitle(), d.getTitle()));
last.setSummary(join(last.getSummary(), d.getSummary()));
if (last.getContentUrl() == null)
last.setContentUrl(d.getContentUrl());
}
MemTimeBenchmark.documents = largeDocs;
}