@Test public void TestDecreasingTimeout() throws Exception { TimeoutStopwatch timeoutStopwatch = new TimeoutStopwatch(1000); long remaining1 = timeoutStopwatch.getRemainingDelayInMilliseconds(); Thread.sleep(100); long remaining2 = timeoutStopwatch.getRemainingDelayInMilliseconds(); assertThat(remaining1).isBetween(0L, 5000L); assertThat(remaining2).isBetween(0L, 5000L); assertThat(remaining2).isLessThanOrEqualTo(remaining1 - 100L); }
public long getRemainingDelayInMilliseconds() { return Math.max(0L, totalTimeoutInMilliseconds - stopWatch.getTime()); }
TimeoutStopwatch { public long getRemainingDelayInMilliseconds() { return Math.max(0L, totalTimeoutInMilliseconds - stopWatch.getTime()); } }
TimeoutStopwatch { public long getRemainingDelayInMilliseconds() { return Math.max(0L, totalTimeoutInMilliseconds - stopWatch.getTime()); } TimeoutStopwatch(long totalTimeoutInMilliseconds); }
TimeoutStopwatch { public long getRemainingDelayInMilliseconds() { return Math.max(0L, totalTimeoutInMilliseconds - stopWatch.getTime()); } TimeoutStopwatch(long totalTimeoutInMilliseconds); long getRemainingDelayInMilliseconds(); }
TimeoutStopwatch { public long getRemainingDelayInMilliseconds() { return Math.max(0L, totalTimeoutInMilliseconds - stopWatch.getTime()); } TimeoutStopwatch(long totalTimeoutInMilliseconds); long getRemainingDelayInMilliseconds();  }