@Test
  @Concurrent(count=4)
  @Repeating(repetition=100)
  public void testDecimalToTimestampCornerCases() {
    Timestamp ts = Timestamp.ofEpochMilli(parseToMillis("1969-03-04 05:44:33"));
    assertEquals(0, ts.toEpochMilli() % 1000);
    for (int nanos : new int[] { 100000, 900000, 999100000, 999900000 }) {
      ts.setNanos(nanos);
      HiveDecimal d = timestampToDecimal(ts);
      assertEquals(ts, TimestampUtils.decimalToTimestamp(d));
      assertEquals(ts, TimestampUtils.doubleToTimestamp(d.bigDecimalValue().doubleValue()));
    }
  }
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