checking in Composite-Pattern