private static Collection < InstanceContextBean > descendantInstances ( final InstanceContextBean instance ) { final Collection < InstanceContextBean > result = new ArrayList < InstanceContextBean > ( ) ; for ( final InstanceContextBean child : instance . getChildren ( ) ) { result . add ( child ) ; result . addAll ( descendantInstances ( child ) ) ; } return result ; }
Returns all the descendant instances of the given instance .