### Question:
TransactionsMessageProcessor { void processTransactionsMessage( final EthPeer peer, final TransactionsMessage transactionsMessage, final Instant startedAt, final Duration keepAlive) { if (startedAt.plus(keepAlive).isAfter(now())) { this.processTransactionsMessage(peer, transactionsMessage); } else { totalSkippedTransactionsMessageCounter.inc(); } } TransactionsMessageProcessor(
      final PeerTransactionTracker transactionTracker,
      final TransactionPool transactionPool,
      final Counter metricsCounter);   }### Answer:
@Test public void shouldMarkAllReceivedTransactionsAsSeen() { messageHandler.processTransactionsMessage( peer1, TransactionsMessage.create(asList(transaction1, transaction2, transaction3)), now(), ofMinutes(1)); verify(transactionTracker) .markTransactionsAsSeen(peer1, ImmutableSet.of(transaction1, transaction2, transaction3)); }
@Test public void shouldAddReceivedTransactionsToTransactionPool() { messageHandler.processTransactionsMessage( peer1, TransactionsMessage.create(asList(transaction1, transaction2, transaction3)), now(), ofMinutes(1)); verify(transactionPool) .addRemoteTransactions(ImmutableSet.of(transaction1, transaction2, transaction3)); }
@Test public void shouldNotMarkReceivedExpiredTransactionsAsSeen() { messageHandler.processTransactionsMessage( peer1, TransactionsMessage.create(asList(transaction1, transaction2, transaction3)), now().minus(ofMinutes(1)), ofMillis(1)); verifyZeroInteractions(transactionTracker); verify(totalSkippedTransactionsMessageCounter).inc(1); }
@Test public void shouldNotAddReceivedTransactionsToTransactionPoolIfExpired() { messageHandler.processTransactionsMessage( peer1, TransactionsMessage.create(asList(transaction1, transaction2, transaction3)), now().minus(ofMinutes(1)), ofMillis(1)); verifyZeroInteractions(transactionPool); verify(totalSkippedTransactionsMessageCounter).inc(1); }