title: Testing with Thread.sleep
body: <p>What are the recommended approaches to using <code>Thread.sleep()</code> to speed up tests.</p>
  
  <p>I am testing a network library with a retry functionality when connections are dropped or timeout errors occur, etc.  The library however, uses a <code>Thread.sleep()</code> between the retries (so it won't connect thousands times while the server is restarting).  The call is slowing the unit tests significantly, and I wonder what the options are to override it.</p>
  
  <p>Note, I'm open to actually changing the code, or using a mocking framework to mock Thread.sleep(), but would like to hear your opinions/recommendation first.</p>