private boolean hasPriority(final PendingTransaction pendingTransaction) {
    // check if there is space for that tx type
    final var txType = pendingTransaction.getTransaction().getType();
    if (txCountByType[txType.ordinal()]
        >= poolConfig
            .getMaxPrioritizedTransactionsByType()
            .getOrDefault(txType, Integer.MAX_VALUE)) {
      return false;
    }

    // if it does not pass the promotion filter, then has not priority
    if (!promotionFilter(pendingTransaction)) {
      return false;
    }

    // if there is space add it, otherwise check if it has more value than the last one
    if (orderByFee.size() < poolConfig.getMaxPrioritizedTransactions()) {
      return true;
    }
    return compareByFee(pendingTransaction, orderByFee.first()) > 0;
  }
Holds the current set of executable pending transactions, that are candidate for inclusion on
next block. The pending transactions are kept sorted by paid fee descending.
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractPrioritizedTransactions.java