}
System.out.println();
Assert.assertNotNull("DayState is not found in the composite", dayinst);
ToolManager manager = (ToolManager) managerinst.getServiceObject();
DayState state = (DayState) dayinst.getServiceObject();
ThreadWrapper_grant thread = new ThreadWrapper_grant(worker1);
System.out.println(">Init : night !");
thread.setDaemon(true);
thread.start();
apam.waitForIt(1000);
manager.printTools();
Assert.assertTrue(
"As the JackHammer is not granted(night), the worker resolution should fails -> thread should be waiting",
thread.isAlive());
System.out.println(">9h : morning !");
state.setHour(9);
apam.waitForIt(1000);
manager.printTools();
Assert.assertFalse(
"As the JackHammer is granted (morning), the worker resolution should be ok, EVEN if instance is external -> thread should be ended",