@Test
public void testManagedTask_Runnable_executionProperties_ManagedTaskListener() {

    RunnableImpl task = new RunnableImpl();
    ManagedTaskListenerImpl taskListener = new ManagedTaskListenerImpl();
    Map<String, String> executionProperties = new HashMap<String, String>();
    final String TASK_NAME = "task1";
    executionProperties.put(ManagedTask.IDENTITY_NAME, TASK_NAME);
    executionProperties.put(ManagedTask.LONGRUNNING_HINT, "true");
    
    Runnable wrapped = ManagedExecutors.managedTask(task, executionProperties, taskListener);
    ManagedTask managedTask = (ManagedTask) wrapped;
    assertTrue(taskListener == managedTask.getManagedTaskListener());
    assertEquals("true", managedTask.getExecutionProperties().get(ManagedTask.LONGRUNNING_HINT));
    assertEquals(TASK_NAME, managedTask.getExecutionProperties().get(ManagedTask.IDENTITY_NAME));
    
    wrapped.run();
    assertTrue(task.ran);
}