public synchronized boolean contains(final T request) {
    final PriorityQueue<T> queue = findQueue(request.getDepth());
    return queue.contains(request)
        || unfinishedOutstandingTasks.stream()
            .map(InMemoryTask::getData)
            .anyMatch(data -> data.equals(request));
  }
Check if queue Contains the task .

@param request the request
@return the boolean
services/tasks/src/main/java/org/hyperledger/besu/services/tasks/InMemoryTasksPriorityQueues.java