public boolean isTaskDeployedAsFinished() {
        if (jobManagerTaskRestore == null) {
            return false;
        }

        return jobManagerTaskRestore.getTaskStateSnapshot().isTaskDeployedAsFinished();
    }
@Test
    void testStateRetrievingWithFinishedOperator() {
        TaskStateSnapshot taskStateSnapshot = TaskStateSnapshot.FINISHED_ON_RESTORE;

        JobManagerTaskRestore jobManagerTaskRestore =
                new JobManagerTaskRestore(2, taskStateSnapshot);
        TaskStateManagerImpl stateManager =
                new TaskStateManagerImpl(
                        new JobID(),
                        createExecutionAttemptId(),
                        new TestTaskLocalStateStore(),
                        null,
                        null,
                        new TaskExecutorStateChangelogStoragesManager(),
                        jobManagerTaskRestore,
                        new TestCheckpointResponder());
        assertThat(stateManager.isTaskDeployedAsFinished()).isTrue();
    }