2121import  java .time .Month ;
2222import  java .time .ZoneId ;
2323import  java .time .ZonedDateTime ;
24+ import  java .time .temporal .ChronoUnit ;
2425import  java .util .ArrayList ;
2526import  java .util .Arrays ;
2627import  java .util .Currency ;
@@ -604,14 +605,14 @@ public void testLocalDateTimeArray(boolean sparse) {
604605            array .setValue (i , value );
605606        }
606607        for  (int  i =0 ; i <values .length ; ++i ) {
607-             final  LocalDateTime  v1  = values [i ];
608+             final  LocalDateTime  v1  = values [i ]. truncatedTo ( ChronoUnit . MILLIS ) ;
608609            final  LocalDateTime  v2  = array .getValue (i );
609610            Assert .assertEquals (v1 , v2 , "Values match at "  + i );
610611        }
611612        array .expand (200 );
612613        Assert .assertEquals (array .length (), 200 , "The array was expanded" );
613614        for  (int  i =0 ; i <values .length ; ++i ) {
614-             final  LocalDateTime  v1  = values [i ];
615+             final  LocalDateTime  v1  = values [i ]. truncatedTo ( ChronoUnit . MILLIS ) ;
615616            final  LocalDateTime  v2  = array .getValue (i );
616617            Assert .assertEquals (v1 , v2 , "Values match at "  + i );
617618        }
@@ -625,7 +626,7 @@ public void testLocalDateTimeArray(boolean sparse) {
625626            array .setValue (i , value );
626627        }
627628        for  (int  i =100 ; i <200 ; ++i ) {
628-             final  LocalDateTime  v1  = values [i -100 ];
629+             final  LocalDateTime  v1  = values [i -100 ]. truncatedTo ( ChronoUnit . MILLIS ) ;
629630            final  LocalDateTime  v2  = array .getValue (i );
630631            Assert .assertEquals (v1 , v2 , "Values match at "  + i );
631632        }
@@ -650,14 +651,14 @@ public void testZonedDateTimeArray(boolean sparse) {
650651            array .setValue (i , value );
651652        }
652653        for  (int  i =0 ; i <values .length ; ++i ) {
653-             final  ZonedDateTime  v1  = values [i ];
654+             final  ZonedDateTime  v1  = values [i ]. truncatedTo ( ChronoUnit . MILLIS ) ;
654655            final  ZonedDateTime  v2  = array .getValue (i );
655656            Assert .assertEquals (v1 , v2 , "Values match at "  + i );
656657        }
657658        array .expand (200 );
658659        Assert .assertEquals (array .length (), 200 , "The array was expanded" );
659660        for  (int  i =0 ; i <values .length ; ++i ) {
660-             final  ZonedDateTime  v1  = values [i ];
661+             final  ZonedDateTime  v1  = values [i ]. truncatedTo ( ChronoUnit . MILLIS ) ;
661662            final  ZonedDateTime  v2  = array .getValue (i );
662663            Assert .assertEquals (v1 , v2 , "Values match at "  + i );
663664        }
@@ -672,7 +673,7 @@ public void testZonedDateTimeArray(boolean sparse) {
672673            array .setValue (i , value );
673674        }
674675        for  (int  i =100 ; i <200 ; ++i ) {
675-             final  ZonedDateTime  v1  = values [i -100 ];
676+             final  ZonedDateTime  v1  = values [i -100 ]. truncatedTo ( ChronoUnit . MILLIS ) ;
676677            final  ZonedDateTime  v2  = array .getValue (i );
677678            Assert .assertEquals (v1 , v2 , "Values match at "  + i );
678679        }
@@ -818,13 +819,15 @@ public <T> void testFill(Class<T> type, ArrayStyle style) {
818819            T  value  = (T )LocalDateTime .now ();
819820            array .fill (value );
820821            for  (int  i =0 ; i <array .length (); ++i ) {
821-                 Assert .assertEquals (array .getValue (i ), value , "Values match at "  + i );
822+                 LocalDateTime  formattedValue  = ((LocalDateTime ) value ).truncatedTo (ChronoUnit .MILLIS );
823+                 Assert .assertEquals (array .getValue (i ), formattedValue , "Values match at "  + i );
822824            }
823825        } else  if  (array .typeCode () == ArrayType .ZONED_DATETIME ) {
824826            T  value  = (T )ZonedDateTime .now ();
825827            array .fill (value );
826828            for  (int  i =0 ; i <array .length (); ++i ) {
827-                 Assert .assertEquals (array .getValue (i ), value , "Values match at "  + i );
829+                  ZonedDateTime  formattedValue  = ((ZonedDateTime ) value ).truncatedTo (ChronoUnit .MILLIS );
830+                  Assert .assertEquals (array .getValue (i ), formattedValue , "Values match at "  + i );
828831            }
829832        } else  if  (array .typeCode () == ArrayType .OBJECT ) {
830833            T  value  = (T )new  Double (7d );
@@ -968,12 +971,12 @@ public <T> void testFirstAndLast(Class<T> type, ArrayStyle style) {
968971            assertFirstAndLast (array , values , arrayType );
969972        } else  if  (arrayType  == ArrayType .LOCAL_DATETIME ) {
970973            final  LocalDateTime [] values  = new  LocalDateTime [1000 ];
971-             for  (int  i =0 ; i <values .length ; ++i ) values [i ] = LocalDateTime .now ().plusSeconds (i );
974+             for  (int  i =0 ; i <values .length ; ++i ) values [i ] = LocalDateTime .now ().plusSeconds (i ). truncatedTo ( ChronoUnit . MILLIS ) ;
972975            final  Array <LocalDateTime > array  = Array .of ((Class <LocalDateTime >)type , values .length , null , style ).applyValues (v  -> values [v .index ()]);
973976            assertFirstAndLast (array , values , arrayType );
974977        } else  if  (arrayType  == ArrayType .ZONED_DATETIME ) {
975978            final  ZonedDateTime [] values  = new  ZonedDateTime [1000 ];
976-             for  (int  i =0 ; i <values .length ; ++i ) values [i ] = ZonedDateTime .now ().plusSeconds (i );
979+             for  (int  i =0 ; i <values .length ; ++i ) values [i ] = ZonedDateTime .now ().plusSeconds (i ). truncatedTo ( ChronoUnit . MILLIS ) ;
977980            final  Array <ZonedDateTime > array  = Array .of ((Class <ZonedDateTime >)type , values .length , null , style ).applyValues (v  -> values [v .index ()]);
978981            assertFirstAndLast (array , values , arrayType );
979982        } else  if  (arrayType  == ArrayType .OBJECT ) {
0 commit comments