public void testRoundTrip() throws Exception {
  assertParseFormatEquals("1995-12-31T23:59:59.999666Z","1995-12-31T23:59:59.999Z");
  assertParseFormatEquals("1995-12-31T23:59:59.999Z","1995-12-31T23:59:59.999Z");
  assertParseFormatEquals("1995-12-31T23:59:59.99Z","1995-12-31T23:59:59.990Z");
  assertParseFormatEquals("1995-12-31T23:59:59.9Z","1995-12-31T23:59:59.900Z");
  assertParseFormatEquals("1995-12-31T23:59:59Z","1995-12-31T23:59:59Z");
  assertParseFormatEquals("1995-12-31T23:59:59.990Z","1995-12-31T23:59:59.990Z");
  assertParseFormatEquals("1995-12-31T23:59:59.900Z","1995-12-31T23:59:59.900Z");
  assertParseFormatEquals("1995-12-31T23:59:59.90Z","1995-12-31T23:59:59.900Z");
  assertParseFormatEquals("1995-12-31T23:59:59.000Z","1995-12-31T23:59:59Z");
  assertParseFormatEquals("1995-12-31T23:59:59.00Z","1995-12-31T23:59:59Z");
  assertParseFormatEquals("1995-12-31T23:59:59.0Z","1995-12-31T23:59:59Z");
  assertParseFormatEquals("1995-12-31T23:59:59Z/DAY","1995-12-31T00:00:00Z");
  assertParseFormatEquals("1995-12-31T23:59:59.123Z/DAY","1995-12-31T00:00:00Z");
  assertParseFormatEquals("1995-12-31T23:59:59.123999Z/DAY","1995-12-31T00:00:00Z");
  assertParseFormatEquals("1995-12-31T23:59:59.987Z",null);
  assertParseFormatEquals("1995-12-31T23:59:59.98Z","1995-12-31T23:59:59.980Z");
  assertParseFormatEquals("1995-12-31T23:59:59.9Z","1995-12-31T23:59:59.900Z");
  assertParseFormatEquals("1995-12-31T23:59:59Z",null);
  assertParseFormatEquals("1976-03-06T03:06:00Z",null);
  assertParseFormatEquals("1995-12-31T23:59:59.987654Z","1995-12-31T23:59:59.987Z");
  assertParseFormatEquals("0001-01-01T01:01:01Z",null);
  assertParseFormatEquals("+12021-12-01T03:03:03Z",null);
  assertParseFormatEquals("0000-04-04T04:04:04Z",null);
  assertParseFormatEquals("-0005-05-05T05:05:05Z",null);
  assertParseFormatEquals("-2021-12-01T04:04:04Z",null);
  assertParseFormatEquals("-12021-12-01T02:02:02Z",null);
}

public void testRoundTrip ( ) throws Exception { assertParseFormatEquals ( "1995-12-31T23:59:59.999666Z" , "1995-12-31T23:59:59.999Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.999Z" , "1995-12-31T23:59:59.999Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.99Z" , "1995-12-31T23:59:59.990Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.9Z" , "1995-12-31T23:59:59.900Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59Z" , "1995-12-31T23:59:59Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.990Z" , "1995-12-31T23:59:59.990Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.900Z" , "1995-12-31T23:59:59.900Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.90Z" , "1995-12-31T23:59:59.900Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.000Z" , "1995-12-31T23:59:59Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.00Z" , "1995-12-31T23:59:59Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.0Z" , "1995-12-31T23:59:59Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59Z/DAY" , "1995-12-31T00:00:00Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.123Z/DAY" , "1995-12-31T00:00:00Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.123999Z/DAY" , "1995-12-31T00:00:00Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.987Z" , null ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.98Z" , "1995-12-31T23:59:59.980Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.9Z" , "1995-12-31T23:59:59.900Z" ) ; assertParseFormatEquals ( "1995-12-31T23:59:59Z" , null ) ; assertParseFormatEquals ( "1976-03-06T03:06:00Z" , null ) ; assertParseFormatEquals ( "1995-12-31T23:59:59.987654Z" , "1995-12-31T23:59:59.987Z" ) ; assertParseFormatEquals ( "0001-01-01T01:01:01Z" , null ) ; assertParseFormatEquals ( "+12021-12-01T03:03:03Z" , null ) ; assertParseFormatEquals ( "0000-04-04T04:04:04Z" , null ) ; assertParseFormatEquals ( "-0005-05-05T05:05:05Z" , null ) ; assertParseFormatEquals ( "-2021-12-01T04:04:04Z" , null ) ; assertParseFormatEquals ( "-12021-12-01T02:02:02Z" , null ) ; }
using dates in the canonical format , verify that parsing + formatting is an identify function
