@Test
  public void getTtlInSecsFromExpiryMsTest() {
    long creationTimeMs = SystemTime.getInstance().milliseconds();
    for (long ttlInSecs : new long[]{1, 20, 1000, Integer.MAX_VALUE, Utils.Infinite_Time, -100,
        -(TimeUnit.MILLISECONDS.toSeconds(creationTimeMs) + 1)}) {
      long expectedTtlSecs = ttlInSecs;
      if (ttlInSecs == Utils.Infinite_Time) {
        expectedTtlSecs = Utils.Infinite_Time;
      } else if (ttlInSecs < 0) {
        expectedTtlSecs = 0;
      }
      long expiresAtMs = Utils.addSecondsToEpochTime(creationTimeMs, ttlInSecs);
      long returnedTtlSecs = Utils.getTtlInSecsFromExpiryMs(expiresAtMs, creationTimeMs);
      assertEquals("TTL not as expected", expectedTtlSecs, returnedTtlSecs);
    }
  }
Tests for {@link Utils#getTtlInSecsFromExpiryMs(long, long)}.
ambry-utils/src/test/java/com/github/ambry/utils/UtilsTest.java