Added composite pattern and test.