private TimeoutCountDown(long timeout, TimeUnit unit) {
        timeoutInMillis = TimeUnit.MILLISECONDS.convert(timeout, unit);
        deadlineInNanos = System.nanoTime() + TimeUnit.NANOSECONDS.convert(timeout, unit);
    }
@Test
    void testTimeoutCountDown() throws InterruptedException {
        TimeoutCountDown timeoutCountDown = TimeoutCountDown.newCountDown(5, TimeUnit.SECONDS);
        Assertions.assertEquals(5 * 1000, timeoutCountDown.getTimeoutInMilli());
        Assertions.assertFalse(timeoutCountDown.isExpired());
        Assertions.assertTrue(timeoutCountDown.timeRemaining(TimeUnit.SECONDS) > 0);
        Assertions.assertTrue(timeoutCountDown.elapsedMillis() < TimeUnit.MILLISECONDS.convert(5, TimeUnit.SECONDS));

        Thread.sleep(6 * 1000);

        Assertions.assertTrue(timeoutCountDown.isExpired());
        Assertions.assertTrue(timeoutCountDown.timeRemaining(TimeUnit.SECONDS) <= 0);
        Assertions.assertTrue(timeoutCountDown.elapsedMillis() > TimeUnit.MILLISECONDS.convert(5, TimeUnit.SECONDS));
    }