What are the recommended approaches to using Thread.sleep() to speed up tests.
I am testing a network library with a retry functionality when connection
Make the sleeping time configurable through a setter, and provide a default value. So in your unit tests, call the setter with a small argument (1 for example), and then execute the method that would call Thread.sleep().
Another similar approach is to make if configurable via a boolean, so that Thread.sleep() isn't called at all if the boolean is set to false.