Design Patterns, Behavioural Design, Java, Software Development.
Abstract class defining the template method abstract class Beverage { // Template method defining the algorithm public final void prepareBeverage() { boilWater(); brew(); pourInCup(); if (addCondiments()) { addCondiments(); } } // Abstract methods to be implemented by subclasses abstract void