class PendingTransactions {

  public OptionalLong getNextNonceForSender(final Address sender) {
    final TransactionsForSenderInfo transactionsForSenderInfo = transactionsBySender.get(sender);
    if (transactionsForSenderInfo == null
        || transactionsForSenderInfo.getTransactionsInfos().isEmpty()) {
      return OptionalLong.empty();
    } else {
      final OptionalLong maybeNextGap = transactionsForSenderInfo.maybeNextGap();
      return maybeNextGap.isEmpty()
          ? OptionalLong.of(transactionsForSenderInfo.getTransactionsInfos().lastKey() + 1)
          : maybeNextGap;
    }
  }

  public  PendingTransactions(
      final int maxTransactionRetentionHours,
      final int maxPendingTransactions,
      final int maxPooledTransactionHashes,
      final Clock clock,
      final MetricsSystem metricsSystem,
      final Supplier<BlockHeader> chainHeadHeaderSupplier,
      final Optional<EIP1559> eip1559,
      final Percentage priceBump);

}