ultTimeSource.getInstance();
     DefaultTimeSource.setInstance(new MockTimeSource());
     try {</b>
       // Now, we can actually test Stopwatch.
       Stopwatch sw = new Stopwatch();
       ...
     <b>} finally {
       DefaultTimeSource.setInstance(original);
     }</b>
   }</pre>

 <p>In practice, supporting this ability to mock out a factory results in
 even more boilerplate code. Tests that mock out and clean up after multiple
 dependencies quickly get out of hand. To make matters worse, a program