if (entity instanceof Car) {
Car c = (Car)entity;
assertFalse(em.contains(c.getModel()));
}
else if (entity instanceof Make) {
Make m = (Make)entity;
List<Model> mds = m.getModels();
for (Model md : mds) {
assertFalse(em.contains(md));
}
}
else if (entity instanceof Model) {
Model m = (Model)entity;
assertFalse(em.contains(m.getCar()));
assertFalse(em.contains(m.getMake()));
}
}
}