}
public static Event createEvent(QName name, Serializable payload)
{
ParameterValidation.throwIllegalArgExceptionIfNull(name, "Event name");
Event event = new Event();
event.setName(name);
if (payload != null)
{
event.setPayload(PayloadUtils.getPayloadAsEventPayload(event, payload));
}
return event;
}