Java, Design Patterns, Structural Design Pattern, Software Engineering.
interface representing the Coffee: public interface Coffee { String getDescription(); double cost(); } Next, we create concrete implementations of the Coffee interface for different types of coffee: public class Espresso implements Coffee { @Override public String getDescription() { return