+ "\"3\":{\"id\":1,\"name\":\"First\",\"manager\":null,\"reports\":[2]},"
+ "\"4\":{\"id\":2,\"name\":\"Second\",\"manager\":1,\"reports\":[]}"
+ "}}";
MappedCompany company = mapper.readValue(json, MappedCompany.class);
assertEquals(4, company.employees.size());
Employee firstEmployee = company.employees.get(2);
Employee secondEmployee = company.employees.get(1);
assertEmployees(firstEmployee, secondEmployee);
// Deser must keep object ordering. Not sure if it's really important for maps,
// but since default map is LinkedHashMap might as well ensure it does...
Iterator<Entry<Integer,Employee>> iterator = company.employees.entrySet().iterator();
assertSame(secondEmployee, iterator.next().getValue());