public void testFindEventsByCriteria() {
executeInTransaction(new TransactionCallback() {
@Override
public void execute() throws Exception {
Resource resource = SessionTestHelper.createNewResource(em, "fake resource");
EventDefinition eventDefinition = createEventDefinition(resource);
em.persist(eventDefinition);
EventSource eventSource = createEventSource(eventDefinition, resource);
em.persist(eventSource);
Set<Event> events = newEventSet();
for (int i = 0; i < 4; i++) {