@Test
public void testDeepMapIndexed() throws Exception {
Mapper mapper = getMapper(new String[] { "genericCollectionMapping.xml" });
Pet[] myPets = new Pet[2];
Family source = newInstance(Family.class, new Object[] {"john", "jane", "doe", new Integer(22000), new Integer(20000)});
Pet firstPet = newInstance(Pet.class, new Object[] {"molly", 2});
myPets[0] = firstPet;
Pet[] offSprings = new Pet[4];
offSprings[0] = newInstance(Pet.class, new Object[] {"Rocky1", 1});
offSprings[1] = newInstance(Pet.class, new Object[] {"Rocky2", 1});
offSprings[2] = newInstance(Pet.class, new Object[] {"Rocky3", 1});
offSprings[3] = newInstance(Pet.class, new Object[] {"Rocky4", 1});
Pet secondPet = newInstance(Pet.class, new Object[] {"Rocky", 3, offSprings});
myPets[1] = secondPet;
// Save the pet details into the source object
source.setPets(myPets);