public static Timestamp toTimestamp(BigDecimal bigDecimal) {
    final BigDecimal nanos = bigDecimal.remainder(BigDecimal.ONE.scaleByPowerOfTen(9));
    final BigDecimal seconds = bigDecimal.subtract(nanos).scaleByPowerOfTen(-9).add(MIN_SECONDS);

    return Timestamp.ofTimeSecondsAndNanos(seconds.longValue(), nanos.intValue());
  }
@Test
  public void testToTimestampConvertNanosToTimestamp() {
    assertEquals(
        Timestamp.ofTimeSecondsAndNanos(10L, 9),
        TimestampUtils.toTimestamp(new BigDecimal("62135596810000000009")));
  }