@Test public void testStopWatch() { MockClock mockClock = MockClock.at(2019, 1, 1, 12, 0, 0, ZoneId.of("UTC")); StopWatch watch = new StopWatch(mockClock); mockClock.advanceBy(Duration.ofSeconds(5)); Duration duration = watch.stop(); LOG.info(watch.toString()); assertThat(duration.getSeconds()).isEqualTo(5); }
StopWatch(Clock clock) { this.clock = clock; this.startTime = clock.instant(); }
StopWatch { StopWatch(Clock clock) { this.clock = clock; this.startTime = clock.instant(); } }
StopWatch { StopWatch(Clock clock) { this.clock = clock; this.startTime = clock.instant(); } StopWatch(Clock clock); }
StopWatch { StopWatch(Clock clock) { this.clock = clock; this.startTime = clock.instant(); } StopWatch(Clock clock); static StopWatch start(); Duration stop(); }
StopWatch { StopWatch(Clock clock) { this.clock = clock; this.startTime = clock.instant(); } StopWatch(Clock clock); static StopWatch start(); Duration stop();  }