title: Testing code which uses ScheduledExecutorService (without using Sleep)
body: <p>I have a validation object which runs input through a series of checks. If an input fails any of the checks, the validation ends.</p>
  <p>Inputs which pass all the checks get grouped based on a sliding time window. This window kicks off when the first piece of input arrives. So this is the flow:</p>
  <ol>
  <li>First input arrives.</li>
  <li>Input passes all checks.</li>
  <li>Since there is no active timer, input is put in a new basket. Timer window begins for N seconds.</li>
  <li>Any subsequent input passing all checks within this timer window will get grouped into the same basket.</li>
  <li>Once the timer goes off, the basket is dispatched.</li>
  <li>Any further valid input will start a new timer, and the process repeats.</li>
  </ol>
  <p>At the moment, to make sure valid inputs get grouped together properly, I'm using Thread.sleep in the unit tests (i.e. Once I send a number of inputs, I sleep for a few seconds, then wake up and make sure the basket which got dispatched contains everything expected).</p>
  <p>This is starting to become annoying as I have over 700 unit tests and this test collection is the bottleneck each time I run the complete suite.</p>
  <p>The time window is simply a ScheduledExecutorService. To be able to test this functionality more quickly, should I create a settable time window object?</p>