@Test
public void test_refer() {
Ioc ioc = I(J("fox", "type:'org.nutz.ioc.json.pojo.Animal',fields:{name:'Fox'}"),
J("rabit", "name:'Rabit',enemies:[{refer:'fox'},{refer:'fox'}]"));
Animal r = ioc.get(Animal.class, "rabit");
Animal f = ioc.get(Animal.class, "fox");
assertEquals(2, r.getEnemies().length);
assertTrue(f == r.getEnemies()[0]);
assertTrue(f == r.getEnemies()[1]);
assertEquals("Fox", f.getName());
assertEquals("Rabit", r.getName());
}