### Question:
Repeater { public Repeater every(long period, TimeUnit unit) { Preconditions.checkArgument(period > 0, "period must be positive: %s", period); checkNotNull(unit, "unit must not be null"); this.period = unit.toMillis(period); return this; } Repeater();  Repeater(Map<?,?> flags);  Repeater(String description);  Repeater(Map<?,?> flags, String description); void setFromFlags(Map<?,?> flags); static Repeater create(); static Repeater create(Map<?,?> flags); static Repeater create(String description); static Repeater create(Map<?,?> flags, String description); Repeater repeat(); Repeater repeat(Runnable body); Repeater repeat(Callable<?> body); Repeater every(long period, TimeUnit unit); Repeater every(Duration duration); Repeater every(groovy.time.Duration duration); Repeater every(long duration); Repeater until(Callable<Boolean> exitCondition); Repeater rethrowException(); Repeater rethrowExceptionImmediately(); Repeater suppressWarnings(); Repeater limitIterationsTo(int iterationLimit); Repeater limitTimeTo(long deadline, TimeUnit unit); Repeater limitTimeTo(Duration duration); boolean run();  }### Answer:
@Test(expectedExceptions = IllegalArgumentException.class) public void everyFailsIfPeriodIsZero() { new Repeater("everyFailsIfPeriodIsZero").every(Duration.ZERO); }
@Test(expectedExceptions = IllegalArgumentException.class) public void everyFailsIfPeriodIsNegative() { new Repeater("everyFailsIfPeriodIsNegative").every(Duration.millis(-1)); }
@Test(expectedExceptions = NullPointerException.class) public void everyFailsIfUnitsIsNull() { new Repeater("everyFailsIfUnitsIsNull").every(10, null); }
@Test public void everySucceedsIfPeriodIsPositiveAndUnitsIsNonNull() { new Repeater("repeatSucceedsIfClosureIsNonNull").every(Duration.millis(10)); }
@Test public void everyAcceptsDuration() { new Repeater("everyAcceptsDuration").every(Duration.ONE_SECOND); }
@Test public void everyAcceptsLong() { new Repeater("everyAcceptsLong").every(1000L); }
@Test public void everyAcceptsTimeUnit() { new Repeater("everyAcceptsTimeUnit").every(1000000L, TimeUnit.MICROSECONDS); }