taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
tasks = taskSummaryResponseHandler.getResults();
assertEquals(1, tasks.size());
Payload payload = handler.getPayload();
TaskCompletedEvent event = ( TaskCompletedEvent ) payload.get();
assertNotNull( event );
BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
client.getTask( taskId, getTaskResponseHandler );
task = getTaskResponseHandler.getTask();
assertEquals( Status.Completed , task.getTaskData().getStatus() );
responseHandler = new BlockingTaskOperationResponseHandler();
client.complete( taskId2, users.get( "bobba" ).getId(), null, responseHandler );
payload = handler.getPayload();
event = ( TaskCompletedEvent ) payload.get();
assertNotNull( event );
BlockingGetTaskResponseHandler getTaskResponseHandler2 = new BlockingGetTaskResponseHandler();
client.getTask( taskId2, getTaskResponseHandler2 );
task2 = getTaskResponseHandler2.getTask();