@Override
  public TransactionAddedResult add(
      final PendingTransaction pendingTransaction, final int gap, final AddReason addReason) {

    // is replacing an existing one?
    TransactionAddedResult addStatus = maybeReplaceTransaction(pendingTransaction);
    if (addStatus == null) {
      addStatus = canAdd(pendingTransaction, gap);
    }

    if (addStatus.equals(TRY_NEXT_LAYER)) {
      return addToNextLayer(pendingTransaction, gap, addReason);
    }

    if (addStatus.isSuccess()) {
      final var addedPendingTransaction =
          addReason.makeCopy() ? pendingTransaction.detachedCopy() : pendingTransaction;
      processAdded(addedPendingTransaction, addReason);
      addStatus.maybeReplacedTransaction().ifPresent(this::replaced);

      nextLayer.notifyAdded(addedPendingTransaction);

      if (!maybeFull()) {
        // if there is space try to see if the added tx filled some gaps
        tryFillGap(addStatus, addedPendingTransaction, getRemainingPromotionsPerType());
      }

      if (addReason.sendNotification()) {
        ethScheduler.scheduleTxWorkerTask(() -> notifyTransactionAdded(addedPendingTransaction));
      }

    } else {
      final var rejectReason = addStatus.maybeInvalidReason().orElseThrow();
      metrics.incrementRejected(pendingTransaction, rejectReason, name());
      LOG.atTrace()
          .setMessage("Transaction {} rejected reason {}")
          .addArgument(pendingTransaction::toTraceLog)
          .addArgument(rejectReason)
          .log();
    }

    return addStatus;
  }
Return the full content of this layer, organized as a list of sender pending txs. For each
sender the collection pending txs is ordered by nonce asc.

@return a list of sender pending txs
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/AbstractTransactionsLayer.java