public synchronized List<T> asList() {
    return new ArrayList<>(internalQueue);
  }
Return task queue as list.

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