assertEquals(6, inner1.getAge());
assertNotNull(hasInnerBeans.getFriends());
Object[] friends = hasInnerBeans.getFriends().toArray();
assertEquals(3, friends.length);
DerivedTestBean inner2 = (DerivedTestBean) friends[0];
assertEquals("inner2", inner2.getName());
assertTrue(inner2.getBeanName().startsWith(DerivedTestBean.class.getName()));
assertFalse(xbf.containsBean("innerBean#1"));
assertNotNull(inner2);
assertEquals(7, inner2.getAge());
TestBean innerFactory = (TestBean) friends[1];
assertEquals(DummyFactory.SINGLETON_NAME, innerFactory.getName());
TestBean inner5 = (TestBean) friends[2];
assertEquals("innerBean#2", inner5.getBeanName());
assertNotNull(hasInnerBeans.getSomeMap());
assertEquals(2, hasInnerBeans.getSomeMap().size());
TestBean inner3 = (TestBean) hasInnerBeans.getSomeMap().get("someKey");
assertEquals("Jenny", inner3.getName());
assertEquals(30, inner3.getAge());
TestBean inner4 = (TestBean) hasInnerBeans.getSomeMap().get("someOtherKey");
assertEquals("inner4", inner4.getName());
assertEquals(9, inner4.getAge());
TestBean hasInnerBeansForConstructor = (TestBean) xbf.getBean("hasInnerBeansForConstructor");
TestBean innerForConstructor = (TestBean) hasInnerBeansForConstructor.getSpouse();
assertNotNull(innerForConstructor);
assertEquals("innerBean#3", innerForConstructor.getBeanName());
assertEquals("inner1", innerForConstructor.getName());
assertEquals(6, innerForConstructor.getAge());
xbf.destroySingletons();
assertTrue(inner1.wasDestroyed());
assertTrue(inner2.wasDestroyed());
assertTrue(innerFactory.getName() == null);
assertTrue(inner5.wasDestroyed());
}