private void setAndVerifyProlepticUpdate(long epochMilli, String expected,
      boolean originalUseProleptic, boolean newUseProleptic) {

    DateFormat testFormatter = getTestFormatter(newUseProleptic);

    Instant instant = Instant.ofEpochMilli(epochMilli); // instant is always a moment in UTC

    int nanos = instant.getNano() + new Random().nextInt(999999) + 0;
    TimestampColumnVector timestampColVector =
        new TimestampColumnVector().setUsingProlepticCalendar(originalUseProleptic);

    timestampColVector.time[0] = instant.toEpochMilli();
    timestampColVector.nanos[0] = nanos;

    timestampColVector.changeCalendar(newUseProleptic, true);

    Assert.assertEquals(expected,
        testFormatter.format(Timestamp.from(Instant.ofEpochMilli(timestampColVector.time[0]))));
    Assert.assertEquals(nanos, timestampColVector.nanos[0]); // preserving nanos
  }
Test case for TimestampColumnVector's changeCalendar
  16768: hybrid: 2015-11-29 proleptic: 2015-11-29
-141418: hybrid: 1582-10-24 proleptic: 1582-10-24
-141427: hybrid: 1582-10-15 proleptic: 1582-10-15
-141428: hybrid: 1582-10-04 proleptic: 1582-10-14
-141430: hybrid: 1582-10-02 proleptic: 1582-10-12
-141437: hybrid: 1582-09-25 proleptic: 1582-10-05
-141438: hybrid: 1582-09-24 proleptic: 1582-10-04
-499952: hybrid: 0601-03-04 proleptic: 0601-03-07
-499955: hybrid: 0601-03-01 proleptic: 0601-03-04
storage-api/src/test/org/apache/hadoop/hive/ql/exec/vector/TestTimestampColumnVector.java