private static void verifySetTimestamp(long time) {
    Timestamp t1 = Timestamp.ofEpochMilli(time);
    TimestampWritableV2 writable = new TimestampWritableV2(t1);
    byte[] bytes = writable.getBytes();
    Timestamp t2 = new Timestamp();
    TimestampWritableV2.setTimestamp(t2, bytes, 0);
    assertEquals(t1, t2);
  }
Test timestamps that don't necessarily fit between 1970 and 2038. This depends on HIVE-4525
being fixed.
serde/src/test/org/apache/hadoop/hive/serde2/io/TestTimestampWritableV2.java