@Test
public void testStartAndWait() {

    FakeTask task = new FakeTask("fake task 0", 100, 10);
    Assert.assertEquals(TaskState.WAITING, task.getState());
    try {
        TaskManager.startAndWait(task);
    } catch (InterruptedException e) {
        e.printStackTrace();
        Assert.assertTrue("exception thrown : " + e.getMessage(), false);
    }
    Assert.assertEquals(TaskState.FINISHED, task.getState());
    Assert.assertEquals(1., task.getProgress());
    Assert.assertEquals(0, task.getTaskListenerCount());
}