System.out.println("FAILED: " + task.getFault());
notify();
}
};
TaskSequence taskSequence = new TaskSequence();
SleepTask task1 = new SleepTask(2000);
taskSequence.add(task1);
SleepTask task2 = new SleepTask(500);
taskSequence.add(task2);
SleepTask task3 = new SleepTask(1000);
taskSequence.add(task3);
synchronized (taskListener) {
taskSequence.execute(taskListener);
try {
taskListener.wait();
} catch (InterruptedException exception) {
}