public EventBean[] toArray(){
  if (firstEvent == null) {
    return new EventBean[0];
  }
  if (additionalEvents == null) {
    return new EventBean[]{firstEvent};
  }
  EventBean[] events=new EventBean[1 + additionalEvents.size()];
  events[0]=firstEvent;
  int count=1;
  for (  EventBean theEvent : additionalEvents) {
    events[count]=theEvent;
    count++;
  }
  return events;
}

public EventBean [ ] toArray ( ) { if ( firstEvent == null ) { return new EventBean [ 0 ] ; } if ( additionalEvents == null ) { return new EventBean [ ] { firstEvent } ; } EventBean [ ] events = new EventBean [ 1 + additionalEvents . size ( ) ] ; events [ 0 ] = firstEvent ; int count = 1 ; for ( EventBean theEvent : additionalEvents ) { events [ count ] = theEvent ; count ++ ; } return events ; }
returns an array holding the collected events .
