public void testRepeatedExecutionJobWithRemove() throws Exception {
TimerService timeService = TimerServiceFactory.getTimerService( ClockType.REALTIME_CLOCK );
Trigger trigger = new DelayedTrigger( new long[] { 100, 100, 100, 100, 100 } );
HelloWorldJobContext ctx = new HelloWorldJobContext( "hello world", timeService);
ctx.setLimit( 3 );
timeService.scheduleJob( new HelloWorldJob(), ctx, trigger);
Thread.sleep( 1000 );
assertEquals( 4, ctx.getList().size() );
}