@Test
  @Concurrent(count=4)
  public void testDecimalToTimestampRandomly() {
    Random rand = new Random(294729777L);
    for (int i = 0; i < 10000; ++i) {
      Timestamp ts = Timestamp.ofEpochMilli(
          randomMillis(MIN_FOUR_DIGIT_YEAR_MILLIS, MAX_FOUR_DIGIT_YEAR_MILLIS, rand));
      ts.setNanos(randomNanos(rand, 9));  // full precision
      assertEquals(ts, TimestampUtils.decimalToTimestamp(timestampToDecimal(ts)));
    }
  }
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