public BigDecimal computeTotalCost(int creditLimit) { BigDecimal totalCost = BigDecimal.ZERO; for (OrderItem o : items) { totalCost = totalCost.add(o.getCost()); } if (creditLimit == 150000) { totalCost = totalCost.subtract(getDiscount(totalCost)); } return totalCost; }