projeto de softwere/CaffeineBeverageWithHook.java
<reponame>WesleyDev184/UFMTpublic abstract class CaffeineBeverageWithHook {
  
  void prepareRecipe() {
    boilWater();
    brew();
    pourInCup();
    if (customerWantsCondiments()) {
      addCondiments();
    }
  }
  
  abstract void brew();
  
  abstract void addCondiments();
  
  void boilWater() {
		System.out.println("Boiling water");
	}
 
	void pourInCup() {
		System.out.println("Pouring into cup");
	}
 
	boolean customerWantsCondiments() {
		return true;
	}
}