@Override
  public void toData(DataOutput out,
      SerializationContext context) throws IOException {
    ClientUpdateMessageImpl cum = (ClientUpdateMessageImpl) haContainer.get(this);

    // If the dispatcher sends the cum object to the client and removes it from
    // the haContainer before we do haContainer.get() (above), we indicate that
    // by sending false boolean value.
    if (cum != null) {
      DataSerializer.writePrimitiveBoolean(true, out);
      context.getSerializer().writeObject(cum.getEventId(), out);
    } else {
      DataSerializer.writePrimitiveBoolean(false, out);
      context.getSerializer().writeObject(new EventID(), out);
      // Create a dummy ClientUpdateMessageImpl instance
      cum = new ClientUpdateMessageImpl(EnumListenerEvent.AFTER_CREATE,
          new ClientProxyMembershipID(), null);
    }
    InternalDataSerializer.invokeToData(cum, out);
    if (cum.hasCqs()) {
      DataSerializer.writeConcurrentHashMap(cum.getClientCqs(), out);
    }
  }
Calls toData() on its clientUpdateMessage present in the haContainer (client-messages-region or
the map).

@param out The output stream which the object should be written to.
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HAEventWrapper.java