### Question:
TransactionPoolReplacementHandler { public boolean shouldReplace( final TransactionInfo existingTransactionInfo, final TransactionInfo newTransactionInfo, final BlockHeader chainHeadHeader) { assert existingTransactionInfo != null; if (newTransactionInfo == null) { return false; } return eip1559 .map( eip -> eip.isValidTransaction( chainHeadHeader.getNumber(), newTransactionInfo.getTransaction())) .orElse(newTransactionInfo.getTransaction().isFrontierTransaction()) && rules.stream() .anyMatch( rule -> rule.shouldReplace( existingTransactionInfo, newTransactionInfo, chainHeadHeader.getBaseFee())); } TransactionPoolReplacementHandler(
      final Optional<EIP1559> eip1559, final Percentage priceBump); @VisibleForTesting  TransactionPoolReplacementHandler(
      final List<TransactionPoolReplacementRule> rules, final Optional<EIP1559> eip1559); boolean shouldReplace(
      final TransactionInfo existingTransactionInfo,
      final TransactionInfo newTransactionInfo,
      final BlockHeader chainHeadHeader);  }### Answer:
@Test public void shouldReplace() { assertThat( new TransactionPoolReplacementHandler(rules, Optional.empty()) .shouldReplace(oldTransactionInfo, newTransactionInfo, header)) .isEqualTo(expectedResult); }