001package headfirst.adapter.ducks; 002 003public class DuckTestDrive { 004 public static void main(String[] args) { 005 MallardDuck duck = new MallardDuck(); 006 007 WildTurkey turkey = new WildTurkey(); 008 Duck turkeyAdapter = new TurkeyAdapter(turkey); 009 010 System.out.println("The Turkey says..."); 011 turkey.gobble(); 012 turkey.fly(); 013 014 System.out.println("\nThe Duck says..."); 015 testDuck(duck); 016 017 System.out.println("\nThe TurkeyAdapter says..."); 018 testDuck(turkeyAdapter); 019 } 020 021 static void testDuck(Duck duck) { 022 duck.quack(); 023 duck.fly(); 024 } 025}