protected void addNewEvent(Object eventKey,T event){
  if (unwrittenEvents == null) {
    unwrittenEvents=Maps.newHashMap();
  }
  List<T> listEvents=unwrittenEvents.get(eventKey);
  if (listEvents == null) {
    unwrittenEvents.put(eventKey,Lists.newArrayList(event));
  }
 else {
    listEvents.add(event);
  }
}

protected void addNewEvent ( Object eventKey , T event ) { if ( unwrittenEvents == null ) { unwrittenEvents = Maps . newHashMap ( ) ; } List < T > listEvents = unwrittenEvents . get ( eventKey ) ; if ( listEvents == null ) { unwrittenEvents . put ( eventKey , Lists . newArrayList ( event ) ) ; } else { listEvents . add ( event ) ; } }
add the given event into the unwritternevents map
