public RecurringJobBuilder withDuration(Duration duration) {
        if (this.schedule != null) {
            throw new IllegalArgumentException("A schedule has already been provided.");
        }
        this.schedule = new Interval(duration);
        return this;
    }
@Test
    void testWithDuration() {
        RecurringJob recurringJob = aRecurringJob()
                .withDuration(Duration.ofMinutes(1))
                .withDetails(() -> testService.doWork())
                .build(jobDetailsGenerator);

        assertThat(recurringJob)
                .hasId()
                .hasScheduleExpression(duration1Minute);
    }