content: package com.alibaba.fastjson2.joda;
  
  import com.alibaba.fastjson2.JSONB;
  import com.alibaba.fastjson2.JSONReader;
  import com.alibaba.fastjson2.JSONWriter;
  import org.joda.time.LocalDate;
  import org.joda.time.chrono.GregorianChronology;
  import org.joda.time.chrono.ISOChronology;
  import org.junit.jupiter.api.Test;
  
  import static org.junit.jupiter.api.Assertions.assertEquals;
  
  public class LocalDateTest {
      @Test
      public void test_0_jsonb() throws Exception {
          LocalDate date = LocalDate.now();
  
          byte[] bytes = JSONB.toBytes(date,
                  JSONWriter.Feature.WriteClassName,
                  JSONWriter.Feature.FieldBased,
                  JSONWriter.Feature.ReferenceDetection,
                  JSONWriter.Feature.WriteNulls,
                  JSONWriter.Feature.NotWriteDefaultValue,
                  JSONWriter.Feature.NotWriteHashMapArrayListClassName
          );
  
          JSONB.dump(bytes);
  
          LocalDate date2 = (LocalDate) JSONB.parseObject(
                  bytes,
                  Object.class,
                  JSONReader.Feature.SupportAutoType,
                  JSONReader.Feature.FieldBased,
                  JSONReader.Feature.UseNativeObject
          );
  
          assertEquals(date, date2);
      }
  
      @Test
      public void test_1_jsonb() throws Exception {
          GregorianChronology utc = GregorianChronology.getInstanceUTC();
          LocalDate date = LocalDate.now(utc);
  
          byte[] bytes = JSONB.toBytes(date,
                  JSONWriter.Feature.WriteClassName,
                  JSONWriter.Feature.FieldBased,
                  JSONWriter.Feature.ReferenceDetection,
                  JSONWriter.Feature.WriteNulls,
                  JSONWriter.Feature.NotWriteDefaultValue,
                  JSONWriter.Feature.NotWriteHashMapArrayListClassName
          );
  
          JSONB.dump(bytes);
  
          LocalDate date2 = (LocalDate) JSONB.parseObject(
                  bytes,
                  Object.class,
                  JSONReader.Feature.SupportAutoType,
                  JSONReader.Feature.FieldBased,
                  JSONReader.Feature.UseNativeObject
          );
  
          assertEquals(date, date2);
      }
  
      @Test
      public void test_2_jsonb() throws Exception {
          ISOChronology utc = ISOChronology.getInstance();
          LocalDate date = LocalDate.now(utc);
  
          byte[] bytes = JSONB.toBytes(date,
                  JSONWriter.Feature.WriteClassName,
                  JSONWriter.Feature.FieldBased,
                  JSONWriter.Feature.ReferenceDetection,
                  JSONWriter.Feature.WriteNulls,
                  JSONWriter.Feature.NotWriteDefaultValue,
                  JSONWriter.Feature.NotWriteHashMapArrayListClassName
          );
  
          JSONB.dump(bytes);
  
          LocalDate date2 = (LocalDate) JSONB.parseObject(
                  bytes,
                  Object.class,
                  JSONReader.Feature.SupportAutoType,
                  JSONReader.Feature.FieldBased,
                  JSONReader.Feature.UseNativeObject
          );
  
          assertEquals(date, date2);
      }
  }
  