@Test
public void should_find_names_of_beans_from_complete_context_hierarchy() {

	//given
	final String childName = "child";
	final String middleName = "middle";
	final String parentName = "parent";
	final ApplicationContext childContext = buildAppContext(Stream.of(bean(childName, new Object())));
	final ApplicationContext middleContext = buildAppContext(childContext, Stream.of(bean(middleName, new Object())));
	final ApplicationContext parentContext = buildAppContext(middleContext, Stream.of(
			withEmptyDoubleRegistry(),
			bean(parentName, new Object())));
	final ApplicationContextWalker walker = new ApplicationContextWalker(parentContext);
	//when
	final Collection<String> beanNames = walker.getBeanDefinitionNames();
	//then
	assertEquals(
			new HashSet<>(asList(childName, middleName, parentName, BEAN_NAME)),
			new HashSet<>(beanNames));
}