### Question:
Repeater { public Repeater limitTimeTo(long deadline, TimeUnit unit) { Preconditions.checkArgument(deadline > 0, "deadline must be positive: %s", deadline); Preconditions.checkNotNull(unit, "unit must not be null"); this.durationLimit = unit.toMillis(deadline); 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 limitTimeToFailsIfPeriodIsZero() { new Repeater("limitTimeToFailsIfPeriodIsZero").limitTimeTo(0, TimeUnit.MILLISECONDS); }
@Test(expectedExceptions = IllegalArgumentException.class) public void limitTimeToFailsIfPeriodIsNegative() { new Repeater("limitTimeToFailsIfPeriodIsNegative").limitTimeTo(-1, TimeUnit.MILLISECONDS); }
@Test(expectedExceptions = NullPointerException.class) public void limitTimeToFailsIfUnitsIsNull() { new Repeater("limitTimeToFailsIfUnitsIsNull").limitTimeTo(10, null); }
@Test public void limitTimeToSucceedsIfPeriodIsPositiveAndUnitsIsNonNull() { new Repeater("limitTimeToSucceedsIfClosureIsNonNull").limitTimeTo(10, TimeUnit.MILLISECONDS); }