JodaOrg/joda-time — pull request #13 by luiz (2013-03-21 18:05:50+00:00)
Title: TimeMachine

This pull request adds a class called TimeMachine to the library. This class encapsulates DateTimeUtils ability to change currentTimeMillis behavior, so that an arbitrary piece of code can be run as if it was in a different period of time.

We use this class a lot here in my company, so I thought it could be useful to JodaTime users in general.

The intended usage is:

TimeMachine.goTo(someDateTime).andExecute(somePieceOfCode); // can be a Runnable or Callable

With Java 8's lambdas, this code will become even more interesting :)