for (long endTime = System.currentTimeMillis() + 60000; endTime > System.currentTimeMillis() && !dempsy.isRunning();) Thread.sleep(1);
assertTrue(dempsy.isRunning());
Thread.sleep(500); // let the thing run for a bit.
dempsy.stop();
// wait for Dempsy to be stopped
for (long endTime = System.currentTimeMillis() + 60000; endTime > System.currentTimeMillis() && dempsy.isRunning();) Thread.sleep(1);
assertFalse(dempsy.isRunning());