code: @Override
      public void doSerialize( JsonWriter writer, T[] values, JsonSerializationContext ctx, JsonSerializerParameters params ) {
          if ( !ctx.isWriteEmptyJsonArrays() && values.length == 0 ) {
              writer.cancelName();
              return;
          }
  
          if ( ctx.isWriteSingleElemArraysUnwrapped() && values.length == 1 ) {
              serializer.serialize( writer, values[0], ctx, params );
          } else {
              writer.beginArray();
              for ( T value : values ) {
                  serializer.serialize( writer, value, ctx, params );
              }
              writer.endArray();
          }
      }
docs: {@inheritDoc}