title: How do I write unit tests to make sure my date/time based code works for all time zones and with/out DST?
body: <p>I'm using JodaTime 2.1 and I'm looking for a pattern to unit test code which performs date/time operations to make sure it behaves well for all time zones and independent of <a href="https://en.wikipedia.org/wiki/Daylight_saving_time" rel="noreferrer">DST</a>.</p>
  
  <p>Specifically:</p>
  
  <ol>
  <li>How can I mock the system clock (so I don't have to mock all the places where I call <code>new DateTime()</code> to get the current time)</li>
  <li>How can I do the same for the default time zone?</li>
  </ol>