Java, Architecture, Clean Code, Solid, Programming.
NotificationSender interface. This approach allows the PaymentService class to remain agnostic of the actual implementation details of the NotificationSender, enabling easier maintenance, testing, and future changes. Thus, the classes depend on abstractions rather than concrete implementations,