package cn.bunny.pattern4.demo1;

public class Main {

    public static void main(String[] args) {
        Car sportsCar = new SportsCar(new BasicCar());
        sportsCar.assemble();  // 输出: Basic Car. Adding features of Sports Car.

        System.out.println("\n*****");

        Car sportsLuxuryCar = new SportsCar(new LuxuryCar(new BasicCar()));
        sportsLuxuryCar.assemble();  // 输出: Basic Car. Adding features of Luxury Car. Adding features of Sports Car.
    }
}
