@Override
 public void serialize(
     final AckMessage ack, final JsonGenerator jgen, final SerializerProvider provider)
     throws IOException, JsonProcessingException {
   jgen.writeStartObject();
   jgen.writeFieldName(AckMessage.MESSSAGE_TYPE_FIELD);
   jgen.writeString(ack.getMessageType().toString().toLowerCase());
   jgen.writeArrayFieldStart(AckMessage.UPDATES_FIELD);
   for (Update update : ack.getUpdates()) {
     jgen.writeStartObject();
     jgen.writeFieldName("channelID");
     jgen.writeString(update.getChannelId());
     jgen.writeFieldName(AckMessage.VERSION_FIELD);
     jgen.writeNumber(update.getVersion());
     jgen.writeEndObject();
   }
   jgen.writeEndArray();
   jgen.writeEndObject();
 }
 @Override
 public void serialize(
     final NotificationMessage notification,
     final JsonGenerator jgen,
     final SerializerProvider provider)
     throws IOException, JsonProcessingException {
   jgen.writeStartObject();
   jgen.writeFieldName(NotificationMessage.MESSSAGE_TYPE_FIELD);
   jgen.writeString(notification.getMessageType().toString().toLowerCase());
   jgen.writeArrayFieldStart(NotificationMessage.UPDATES_FIELD);
   for (Update update : notification.getUpdates()) {
     jgen.writeStartObject();
     jgen.writeFieldName(RegisterMessage.CHANNEL_ID_FIELD);
     jgen.writeString(update.getChannelId());
     jgen.writeFieldName(NotificationMessage.VERSION_FIELD);
     jgen.writeNumber(update.getVersion());
     jgen.writeEndObject();
   }
   jgen.writeEndArray();
   jgen.writeEndObject();
 }