### Question:
SpeedCalculator { public synchronized long getInstantSpeedDurationMillis() { return nowMillis() - timestamp; }  synchronized void reset(); synchronized void downloading(long increaseBytes); synchronized void flush(); long getInstantBytesPerSecondAndFlush(); synchronized long getBytesPerSecondAndFlush(); synchronized long getBytesPerSecondFromBegin(); synchronized void endTask(); String instantSpeed(); String speed(); String lastSpeed(); synchronized long getInstantSpeedDurationMillis(); String getSpeedWithBinaryAndFlush(); String getSpeedWithSIAndFlush(); String averageSpeed(); String speedFromBegin();  }### Answer:
@Test public void getInstantSpeedDurationMillis() { doReturn(2L).when(calculator).nowMillis(); calculator.timestamp = 1; assertThat(calculator.getInstantSpeedDurationMillis()).isOne(); }