@Test
public void testVisitEvents_BetweenTimestamps() {
EventVisitor eventVisitor = mock(EventVisitor.class);
DateTimeUtils.setCurrentMillisFixed(new DateTime(2011, 12, 18, 12, 59, 59, 999).getMillis());
testSubject.appendEvents("test", new SimpleDomainEventStream(createDomainEvents(11)));
DateTime onePM = new DateTime(2011, 12, 18, 13, 0, 0, 0);
DateTimeUtils.setCurrentMillisFixed(onePM.getMillis());
testSubject.appendEvents("test", new SimpleDomainEventStream(createDomainEvents(12)));
DateTime twoPM = new DateTime(2011, 12, 18, 14, 0, 0, 0);
DateTimeUtils.setCurrentMillisFixed(twoPM.getMillis());
testSubject.appendEvents("test", new SimpleDomainEventStream(createDomainEvents(13)));
DateTimeUtils.setCurrentMillisFixed(new DateTime(2011, 12, 18, 14, 0, 0, 1).getMillis());
testSubject.appendEvents("test", new SimpleDomainEventStream(createDomainEvents(14)));
DateTimeUtils.setCurrentMillisSystem();
CriteriaBuilder criteriaBuilder = testSubject.newCriteriaBuilder();
testSubject.visitEvents(criteriaBuilder.property("timeStamp").greaterThanEquals(onePM)
.and(criteriaBuilder.property("timeStamp").lessThanEquals(twoPM)),