// One potential owner, should go straight to state Reserved
String str = "(with (new Task()) { priority = 55, taskData = (with( new TaskData()) { } ), ";
str += "peopleAssignments = (with ( new PeopleAssignments() ) { potentialOwners = [users['bobba' ], users['darth'] ], }),";
str += "names = [ new I18NText( 'en-UK', 'This is my task name')] })";
BlockingAddTaskResponseHandler addTaskResponseHandler = new BlockingAddTaskResponseHandler();
Task task = ( Task ) eval( new StringReader( str ), vars );
client.addTask( task, null, addTaskResponseHandler );
long taskId = addTaskResponseHandler.getTaskId();
// Check is Delegated
BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
client.delegate( taskId, users.get( "darth" ).getId(), users.get( "tony" ).getId(), responseHandler );
responseHandler.waitTillDone(DEFAULT_WAIT_TIME);