DefaultJodaTimeDateFactory extends AbstractJodaTimeDateFactory { @Override public DateTime newDateTime() { return new DateTime(); }  @Override DateTime newDateTime();  }
@Test public void testNewDateTime() { JodaTimeDateFactory factory = new DefaultJodaTimeDateFactory(); long currentTimeMillis = System.currentTimeMillis(); DateTimeUtils.setCurrentMillisFixed(currentTimeMillis); try { DateTime result = factory.newDateTime(); assertThat(result.getMillis(), is(currentTimeMillis)); } finally { DateTimeUtils.setCurrentMillisSystem(); } }