For some testing purposes I would like to predict exactly what System.currentTimeMillis() will return. Is there any way in which I can freeze or manually set what w
The new java.time package built into Java 8 includes a java.time.Clock interface "to allow alternate clocks to be plugged in as and when required. Use this instead.