eventStore.appendEvents("UpcasterSample", new SimpleDomainEventStream(
new GenericDomainEventMessage("todo2", 0, new ToDoItemCreatedEvent("todo2", "I also need to do this"))
));
// now, we read the events from the "todo1" stream
DomainEventStream eventStream = eventStore.readEvents("UpcasterSample", "todo1");
while (eventStream.hasNext()) {
// and print them, so that we can see what we ended up with
System.out.println(eventStream.next().getPayload().toString());
}
IOUtils.closeQuietlyIfCloseable(eventStream);