}
@Override
protected Money doCalculationForAmountToPay(Event event, DateTime when, boolean applyDiscount) {
final Money amountToPay = ((PastDegreeGratuityEvent) event).getPastDegreeGratuityAmount();
final PastDegreeGratuityEvent pastDegreeGratuityEvent = (PastDegreeGratuityEvent) event;
final BigDecimal discountPercentage =
applyDiscount ? pastDegreeGratuityEvent.calculateDiscountPercentage(amountToPay) : BigDecimal.ZERO;
return amountToPay.multiply(BigDecimal.ONE.subtract(discountPercentage));
}