Set<IBean> beans = BeansModelUtils.getBeansByContainingTypes(resource, typeEngine, null);
assertEquals(3, beans.size());
Iterator<IBean> iterator = beans.iterator();
IBean bean1 = iterator.next();
IBean bean2 = iterator.next();
IBean bean3 = iterator.next();
assertTrue("chainedFactoryCreatedBean".equals(bean1.getElementName()) || "chainedFactoryCreatedBean".equals(bean2.getElementName()) || "chainedFactoryCreatedBean".equals(bean3.getElementName()));
assertTrue("chainedFactoryBean1".equals(bean1.getElementName()) || "chainedFactoryBean1".equals(bean2.getElementName()) || "chainedFactoryBean1".equals(bean3.getElementName()));
assertTrue("chainedFactoryBean2".equals(bean1.getElementName()) || "chainedFactoryBean2".equals(bean2.getElementName()) || "chainedFactoryBean2".equals(bean3.getElementName()));
}