package io.github.zutherb.appstash.shop.service.cart.impl;

import io.github.zutherb.appstash.shop.service.cart.model.CartItemInfo;

import java.math.BigDecimal;
import java.util.List;

public abstract class AbstractFulfillmentProvider {
    
    public BigDecimal getTotalSum() {
        BigDecimal sum = BigDecimal.ZERO;
        for (CartItemInfo cartItemInfo : getAllItems()) {
            sum = sum.add(cartItemInfo.getTotalSum());
        }
        return sum;
    }

    public abstract List<CartItemInfo> getAllItems();
}

@@ -451,18 +451,428 @@
     
-return sum
+double fraction = 0.25/100;        %0A        return sum.subtract(sum.multiply(new BigDecimal(fraction)));%0A    %7D%0A    %0A    public BigDecimal getDiscountSum() %7B%0A        BigDecimal sum = BigDecimal.ZERO;%0A        for (CartItemInfo cartItemInfo : getAllItems()) %7B%0A            sum = sum.add(cartItemInfo.getTotalSum());%0A        %7D%0A        %0A        double fraction = 0.25/100;%0A        return sum.multiply(new BigDecimal(fraction))
 ;%0A  

Update AbstractFulfillmentProvider.java