Composite Design Pattern in Java