### Question:
PeriodicWatch extends ThresholdWatch implements PeriodicWatchMBean { public long getPeriod() { return (period); } PeriodicWatch(String id);  PeriodicWatch(String id, Configuration config);  PeriodicWatch(WatchDataSource watchDataSource, String id); void start(); void stop(); long getPeriod(); void setPeriod(long newPeriod); static final long DEFAULT_PERIOD; }### Answer:
@Test public void testGetPeriod() { MyPeriodicWatch watch = new MyPeriodicWatch("watch"); Assert.assertEquals(PeriodicWatch.DEFAULT_PERIOD, watch.getPeriod()); for (int i = 0; i < 10; i++) { long value = Math.round(Math.random() * 100) + 1; watch.setPeriod(value); Assert.assertEquals(value, watch.getPeriod()); } Utils.close(watch.getWatchDataSource()); }