private synchronized boolean markTaskCompleted(final InMemoryTask<T> task) {
    return unfinishedOutstandingTasks.remove(task);
  }
Return task queue as list.

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