@Override
 protected void doSerialize(
     JsonWriter writer,
     Timestamp value,
     JsonSerializationContext ctx,
     JsonSerializerParameters params) {
   if (ctx.isWriteDatesAsTimestamps() || params.getShape().isNumeric()) {
     writer.value(value.getTime());
   } else {
     String date = DateFormat.format(params, value);
     if (null == params.getPattern()) {
       writer.unescapeValue(date);
     } else {
       writer.value(date);
     }
   }
 }
  /** {@inheritDoc} */
  @Override
  public void doSerialize(
      JsonWriter writer,
      boolean[][] values,
      JsonSerializationContext ctx,
      JsonSerializerParameters params) {
    if (!ctx.isWriteEmptyJsonArrays() && values.length == 0) {
      writer.cancelName();
      return;
    }

    writer.beginArray();
    for (boolean[] array : values) {
      writer.beginArray();
      for (boolean value : array) {
        writer.value(value);
      }
      writer.endArray();
    }
    writer.endArray();
  }