@Test
public void should_find_bean_definition_from_any_context_in_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 BeanDefinition childDefinition = walker.getBeanDefinition(childName);
	final BeanDefinition middleDefinition = walker.getBeanDefinition(middleName);
	final BeanDefinition parentDefinition = walker.getBeanDefinition(parentName);
	//then
	assertNotNull(childDefinition);
	assertNotNull(middleDefinition);
	assertNotNull(parentDefinition);
}