public class OrderService { public double calculateTotal(double price, int quantity) { assert price >= 0 : "Price must be non-negative"; assert quantity > 0 : "Quantity must be positive"; return price * quantity; } public double applyDiscount(double total, double discountPercent) { if (discountPercent < 0 || discountPercent > 50) { throw new IllegalArgumentException("Invalid discount"); } return total - (total * discountPercent / 100); } public String categorizeOrder(double total) { if (total < 100) { return "SMALL"; } else if (total < 500) { return "MEDIUM"; } else { return "LARGE"; } } public boolean isFreeShipping(double total) { return total >= 200; } }