class TransactionReplacementByPriceRule implements TransactionPoolReplacementRule {

  @Override
  public boolean shouldReplace(
      final TransactionInfo existingTransactionInfo,
      final TransactionInfo newTransactionInfo,
      final Optional<Long> baseFee) {
    assert existingTransactionInfo.getTransaction() != null
        && newTransactionInfo.getTransaction() != null;
    final Wei replacementThreshold =
        priceOf(existingTransactionInfo.getTransaction(), baseFee)
            .multiply(100 + priceBump.getValue())
            .divide(100);
    return priceOf(newTransactionInfo.getTransaction(), baseFee).compareTo(replacementThreshold)
        > 0;
  }

  public  TransactionReplacementByPriceRule(final Percentage priceBump);

}