Stack<Event> beforeEvents = new Stack<Event>();
List<Event> newActivations = new ArrayList<Event>();
Map<String, Event> activationMap = new HashMap<String, Event>();
Map<Long, Event> objectMap = new HashMap<Long, Event>();
while (iterator.hasNext()) {
LogEvent inEvent = (LogEvent) iterator.next();
Event event = new Event(inEvent.getType());
switch (inEvent.getType()) {
case LogEvent.INSERTED:
ObjectLogEvent inObjectEvent = (ObjectLogEvent) inEvent;
event.setString("Object inserted (" + inObjectEvent.getFactId() + "): " + inObjectEvent.getObjectToString());
if (!beforeEvents.isEmpty()) {
((Event) beforeEvents.peek()).addSubEvent(event);