### Question:
PendingTransactions { public boolean addRemoteTransaction(final Transaction transaction) { final TransactionInfo transactionInfo = new TransactionInfo(transaction, false, clock.instant()); final TransactionAddedStatus transactionAddedStatus = addTransaction(transactionInfo); final boolean added = transactionAddedStatus.equals(ADDED); if (added) { remoteTransactionAddedCounter.inc(); } return added; } 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); void evictOldTransactions(); boolean addRemoteTransaction(final Transaction transaction); @VisibleForTesting TransactionAddedStatus addLocalTransaction(final Transaction transaction); void selectTransactions(final TransactionSelector selector); long maxSize(); int size(); boolean containsTransaction(final Hash transactionHash); Optional<Transaction> getTransactionByHash(final Hash transactionHash); Set<TransactionInfo> getTransactionInfo(); OptionalLong getNextNonceForSender(final Address sender); void tryEvictTransactionHash(final Hash hash);  }### Answer:
@Test public void shouldGetTransactionByHash() { transactions.addRemoteTransaction(transaction1); assertTransactionPending(transaction1); }
@Test public void shouldTrackMaximumNonceForEachSender() { transactions.addRemoteTransaction(transactionWithNonceAndSender(0, KEYS1)); assertMaximumNonceForSender(SENDER1, 1); transactions.addRemoteTransaction(transactionWithNonceAndSender(1, KEYS1)); assertMaximumNonceForSender(SENDER1, 2); transactions.addRemoteTransaction(transactionWithNonceAndSender(2, KEYS1)); assertMaximumNonceForSender(SENDER1, 3); transactions.addRemoteTransaction(transactionWithNonceAndSender(20, KEYS2)); assertMaximumNonceForSender(SENDER2, 21); assertMaximumNonceForSender(SENDER1, 3); }