### Question:
Task extends Thread { public void setExecutionContext(String taskId, TaskExecutionContext context) { this.taskId = taskId; this.context = context; setName("Task thread for task.id=" + taskId); setDaemon(false); } Task(); void setExecutionContext(String taskId, TaskExecutionContext context); @Override void run(); boolean isCanceledOrInterrupted(); void setCanceled(boolean canceled);  }### Answer:
@Test public void setExecutionContext() { Task tested = getTested(); TaskExecutionContext context = Mockito.mock(TaskExecutionContext.class); tested.setExecutionContext("mytaskid", context); Assert.assertEquals("mytaskid", tested.taskId); Assert.assertEquals(context, tested.context); Assert.assertFalse(tested.isDaemon()); }