public long taken() {
        if (start > 0) {
            long delta = System.nanoTime() - start;
            return Duration.ofNanos(delta).toMillis();
        }
        return 0;
    }
@Test
    void testDurationMatchesExpect() throws InterruptedException {
        StopWatch stopWatch = new StopWatch();

        Thread.sleep(Duration.ofSeconds(1).toMillis());

        long taken = stopWatch.taken();
        assertTrue(taken >= 1000, "Elapsed time should be equal to or greater than 1000 ms but was " + taken);
        assertTrue(taken < 1500, "Elapsed time should be smaller than 1500 ms but was " + taken);
    }