TaskService.complete method documentation problem

TaskService.complete(String taskId) description says:

Throws ProcessEngineException when no task exists with the given id or when this task is DelegationState.PENDING delegation.

But description of TaskService.complete(String taskId, Map<String, Object> variables) says:

Throws ProcessEngineException when no task exists with the given id.

From the methods description and my tests, this is one of three problems.

1 - The description of the method TaskService.complete(String taskId) is incorrect;
2 - Status check functionality is not implemented or does not work (I can’t find any tests for this case in TaskServiceTest);
3 - I didn’t understand how to use the method;

The method allows you to close the task even if it is in the PENDING state.

taskService.setOwner(getTask(taskService).getId(), "1");
taskService.delegateTask(getTask(taskService).getId(), "2");
taskService.complete(getTask(taskService).getId());