### Question:
AbstractManagedObjectDefinition { public final Collection<AbstractManagedObjectDefinition<? extends C, ? extends S>> getAllChildren() { List<AbstractManagedObjectDefinition<? extends C, ? extends S>> list = new ArrayList<>(children.values()); for (AbstractManagedObjectDefinition<? extends C, ? extends S> child : children.values()) { list.addAll(child.getAllChildren()); } return Collections.unmodifiableCollection(list); } protected  AbstractManagedObjectDefinition(String name,
        AbstractManagedObjectDefinition<? super C, ? super S> parent); final Collection<AbstractManagedObjectDefinition<? extends C, ? extends S>> getAllChildren(); final Collection<Constraint> getAllConstraints(); final Collection<PropertyDefinition<?>> getAllPropertyDefinitions(); final Collection<RelationDefinition<?, ?>> getAllRelationDefinitions(); final Collection<RelationDefinition<? super C, ? super S>> getAllReverseRelationDefinitions(); final Collection<AggregationPropertyDefinition<?, ?>> getAllAggregationPropertyDefinitions(); final Collection<AggregationPropertyDefinition<?, ?>> getAllReverseAggregationPropertyDefinitions(); final Collection<Tag> getAllTags(); final AbstractManagedObjectDefinition<? extends C, ? extends S> getChild(String name); final Collection<AbstractManagedObjectDefinition<? extends C, ? extends S>> getChildren(); final Collection<Constraint> getConstraints(); final LocalizableMessage getDescription(); final LocalizableMessage getDescription(Locale locale); final String getName(); final AbstractManagedObjectDefinition<? super C, ? super S> getParent(); final PropertyDefinition<?> getPropertyDefinition(String name); final Collection<PropertyDefinition<?>> getPropertyDefinitions(); final RelationDefinition<?, ?> getRelationDefinition(String name); final Collection<RelationDefinition<?, ?>> getRelationDefinitions(); final Collection<RelationDefinition<C, S>> getReverseRelationDefinitions(); final AggregationPropertyDefinition<?, ?> getAggregationPropertyDefinition(String name); final Collection<AggregationPropertyDefinition<?, ?>> getAggregationPropertyDefinitions(); final Collection<AggregationPropertyDefinition<?, ?>> getReverseAggregationPropertyDefinitions(); final LocalizableMessage getSynopsis(); final LocalizableMessage getSynopsis(Locale locale); final LocalizableMessage getUserFriendlyName(); final LocalizableMessage getUserFriendlyName(Locale locale); final LocalizableMessage getUserFriendlyPluralName(); final LocalizableMessage getUserFriendlyPluralName(Locale locale); final boolean hasChildren(); final boolean hasOption(ManagedObjectOption option); final boolean hasTag(Tag t); final boolean isChildOf(AbstractManagedObjectDefinition<?, ?> d); final boolean isParentOf(AbstractManagedObjectDefinition<?, ?> d); final boolean isTop(); final ManagedObjectDefinition<? extends C, ? extends S> resolveManagedObjectDefinition(DefinitionResolver r); @Override final String toString(); final void toString(StringBuilder builder);  }### Answer:
@Test public void testGetAllChildrenOfTop() { Collection<AbstractManagedObjectDefinition> children = top.getAllChildren(); assertThat(children).hasSize(5); assertThat(children).containsOnly(middle1, middle2, bottom1, bottom2, bottom3); }
@Test public void testGetAllChildrenOfMiddle() { Collection<AbstractManagedObjectDefinition> children = middle1.getAllChildren(); assertThat(children).hasSize(3); assertThat(children).containsOnly(bottom1, bottom2, bottom3); }
@Test public void testGetAllChildrenNoChild() { Collection<AbstractManagedObjectDefinition> children = middle2.getAllChildren(); assertThat(children).isEmpty(); }