@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();
    }
}