BranchOfTreeSpecification plainBranch = new UndecoratedBranch();
BranchOfTreeSpecification lightBranch = new LightsDecorator(plainBranch);
BranchOfTreeSpecification ballBranch = new BallDecorator(plainBranch);
BranchOfTreeSpecification starBranch = new StarDecorator(plainBranch);
XMASTree myTree2Light2Ball = new XMASTree(4);
myTree2Light2Ball.addDecorator(lightBranch);
myTree2Light2Ball.animate();
myTree2Light2Ball.addDecorator(lightBranch);
myTree2Light2Ball.addDecorator(ballBranch);
myTree2Light2Ball.addDecorator(ballBranch);
System.out.println("\nXMAS tree with 2 lights - 2 ball");
System.out.println("myTree2Light2Ball.getDecorations():"
+ myTree2Light2Ball.getDecorations());
myTree2Light2Ball.animate();
System.out.println("myTree2Light2Ball.animate.getDecorations():"
+ myTree2Light2Ball.getDecorations());
// XMASTree myTree2Light3Star = new XMASTree();
// myTree2Light3Star.addBranch(new LightsDecorator(plainBranch));
// myTree2Light3Star.addBranch(new LightsDecorator(plainBranch));
// myTree2Light3Star.addBranch(new StarDecorator(plainBranch));