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