@Test
public void checkTaskExecution()
        throws Exception {

    IObject env = mock(IObject.class);
    IObject context = mock(IObject.class);
    List<IAction> finalActions = new ArrayList<>();
    when(env.getValue(new FieldName("context"))).thenReturn(null).thenReturn(context);
    when(context.getValue(new FieldName("finalActions"))).thenReturn(null).thenReturn(finalActions);
    Checker checker = new Checker();
    IAction action = new IAction() {
        @Override
        public void execute(Object actingObject) throws ActionExecuteException, InvalidArgumentException {
            checker.setChecked(true);
        }
    };
    finalActions.add(action);
    ITask task = new FinalTask(env);
    // context is null
    task.execute();
    // finalActions is null
    task.execute();
    // finalAction contains one action
    task.execute();
    assertEquals(checker.isChecked(), true);
}