diff --git a/activiti-engine/src/test/java/org/activiti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.java b/activiti-engine/src/test/java/org/activiti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.java
index <HASH>..<HASH> 100644
--- a/activiti-engine/src/test/java/org/activiti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.java
+++ b/activiti-engine/src/test/java/org/activiti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.java
@@ -93,6 +93,7 @@ public class TaskCandidateTest extends ActivitiInternalTestCase {
       .assignee(KERMIT)
       .list();
     assertEquals(1, tasks.size());
+    task = tasks.get(0);
     assertEquals("Pay out expenses", task.getName());
 
     // Completing the task ends the process
Improved TaskCandidateTest by getting the task fresh from the user's task list after claiming it from a candidate task list