}
}
@Test
public void testEntity2NoBindingCollectionRootKeyNull() {
City city = null;
Entity2 entity2 = null;
try {
entity2 = new Entity2();
entity2.a = "testNewEntity2";
entity2.b = true;
entity2.c = 1;
city = new City();
city.name = "Name";
city.save();
entity2.city = city;
entity2.cities = new ArrayList<City>();
entity2.cities.add(city);
entity2.save();
Params params = new Params();
params.put("entity2", (String) null);
Validation.clear();
ParamNode rootParamNode = ParamNode.convert(params.all());
entity2.edit(rootParamNode, "entity2");
assertFalse(Validation.hasErrors());
entity2.save();
entity2.refresh();
assertEquals(1, entity2.cities.size());
assertEquals(city.name, entity2.cities.get(0).name);
} finally {
if (entity2 != null && entity2.id != null) {
entity2.delete();
}
if (city != null && city.id != null) {
city.delete();
}
}
}