### Question:
PeriodicDirectoryScanner implements DirectoryScanner { public void setScanInterval(final int scanInterval) { if (scanInterval <= 0) { throw new IllegalArgumentException( "interval is expressed in milliseconds and cannot be less or equal to zero" ); } this.scanInterval = scanInterval; } PeriodicDirectoryScanner(final DirectoryScanner delegate, final TimeService time); void setScanInterval(final int scanInterval); @Override void scan(final FileChangeListener listener); static final int TEN_SECONDS; }### Answer:
@Test(dataProvider = "invalidPeriods", expectedExceptions = IllegalArgumentException.class) public void testInvalidPeriod(int period) throws Exception { PeriodicDirectoryScanner scanner = new PeriodicDirectoryScanner(delegate, time); scanner.setScanInterval(period); }