@Test
public void testUnderLoadTypical() throws ParseException {

    // Every Day
    SimpleCronScheduler executor = new SimpleCronScheduler(SimpleCron.compile("0 0 *")) {
        @Override
        protected Long getCurrentTime() {
            return currentTime;
        }
    };
    // Application starts at 2pm
    currentTime = DateUtil.parseNormalDateTimeString("2010-03-29T14:00:00.000Z");
    Assert.assertFalse(executor.execute());
    Assert.assertFalse(executor.execute());
    // Our 1 minute thread timer fires a bit later
    currentTime = DateUtil.parseNormalDateTimeString("2010-03-29T14:01:10.000Z");
    Assert.assertFalse(executor.execute());
    // And Again
    currentTime = DateUtil.parseNormalDateTimeString("2010-03-29T14:02:11.000Z");
    Assert.assertFalse(executor.execute());
    // And just before it rolls
    currentTime = DateUtil.parseNormalDateTimeString("2010-03-29T23:59:59.999Z");
    Assert.assertFalse(executor.execute());
    // Now it should roll but we are under load to we don't fire under a lot
    // later
    currentTime = DateUtil.parseNormalDateTimeString("2010-03-30T01:59:59.999Z");
    Assert.assertTrue(executor.execute());
    Assert.assertFalse(executor.execute());
}