class Invoice { private final String id; private final double amount; public Invoice(String id, double amount) { this.id = id; this.amount = amount; } public String getId() { return id; } public double getAmount() { return amount; } } interface Notifier { void notify(String message); } class EmailNotifier implements Notifier { @Override public void notify(String message) { System.out.println("Sending EMAIL with message: " + message); } } class SMSNotifier implements Notifier { @Override public void notify(String message) { System.out.println("Sending SMS with message: " + message); } } class InvoiceProcessor { public void send(Invoice invoice, Notifier notifier) { String msg = "Invoice " + invoice.getId() + " for amount " + invoice.getAmount() + "DZD"; notifier.notify(msg); System.out.println("Invoice sent successfully."); } } public class Example02 { public static void main(String[] args) { Invoice invoice = new Invoice("INV-001", 250.0); InvoiceProcessor processor = new InvoiceProcessor(); processor.send(invoice, new EmailNotifier()); processor.send(invoice, new SMSNotifier()); } }