}
@Test
public void testDeepMapIndexed() throws Exception {
Pet[] myPets = new Pet[2];
Family source = new Family("john", "jane", "doe", new Integer(22000), new Integer(20000));
Pet firstPet = new Pet("molly", 2, null);
myPets[0] = firstPet;
Pet[] offSprings = new Pet[4];
offSprings[0] = new Pet("Rocky1", 1, null);
offSprings[1] = new Pet("Rocky2", 1, null);
offSprings[2] = new Pet("Rocky3", 1, null);
offSprings[3] = new Pet("Rocky4", 1, null);
Pet secondPet = new Pet("Rocky", 3, offSprings);
myPets[1] = secondPet;
// Save the pet details into the source object
source.setPets(myPets);
HeadOfHouseHold dest = mapper.map(source, HeadOfHouseHold.class);
assertEquals(((PersonalDetails) source.getFamilyMembers().get(0)).getFirstName(), dest.getFirstName());
assertEquals(((PersonalDetails) source.getFamilyMembers().get(0)).getLastName(), dest.getLastName());
assertEquals(((PersonalDetails) source.getFamilyMembers().get(0)).getSalary(), dest.getSalary());
assertEquals(source.getPets()[1].getPetName(), dest.getPetName());
assertEquals(String.valueOf(source.getPets()[1].getPetAge()), dest.getPetAge());
assertEquals(source.getPets()[1].getOffSpring()[2].getPetName(), dest.getOffSpringName());
}