private synchronized void handleFailedTask(final InMemoryTask<T> task) {
    if (markTaskCompleted(task)) {
      add(task.getData());
    }
  }
Return task queue as list.

@return the list
services/tasks/src/main/java/org/hyperledger/besu/services/tasks/InMemoryTaskQueue.java