private boolean validateTo(
      final PendingTransaction pendingTransaction, final Predicate predicate, final String value)
      throws InvalidJsonRpcParameters {
    final Optional<Address> maybeTo = pendingTransaction.getTransaction().getTo();
    if (maybeTo.isPresent() && predicate.equals(EQ)) {
      return predicate.getOperator().apply(maybeTo.get(), Address.fromHexString(value));
    } else if (predicate.equals(ACTION)) {
      return pendingTransaction.getTransaction().isContractCreation();
    }
    return false;
  }
This class allows to filter a list of pending transactions

<p>Here is the list of fields that can be used to filter a transaction : from, to, gas, gasPrice,
value, nonce
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/transaction/pool/PendingTransactionFilter.java