001package headfirst.templatemethod.barista; 002 003public abstract class CaffeineBeverage { 004 005 final void prepareRecipe() { 006 boilWater(); 007 brew(); 008 pourInCup(); 009 addCondiments(); 010 } 011 012 abstract void brew(); 013 014 abstract void addCondiments(); 015 016 void boilWater() { 017 System.out.println("Boiling water"); 018 } 019 020 void pourInCup() { 021 System.out.println("Pouring into cup"); 022 } 023}