List<Event> events = new ArrayList<Event>();
int batchSize = 1024;
boolean distinctDates = true;
long lastDate = Long.MIN_VALUE;
while (journal.hasNext() && (batchSize > 0 || !distinctDates)) {
Event e = factory.fromJCREvent(journal.nextEvent());
if (filter.accept(e, false)) {
distinctDates = lastDate != e.getDate();
lastDate = e.getDate();
events.add(e);
batchSize--;