Callable<Void> call = new Callable<Void>()
{
@Override
public Void call() throws Exception
{
ViolationType t1 = ReportModelFactory.eINSTANCE.createViolationType();
ViolationType t2 = ReportModelFactory.eINSTANCE.createViolationType();
accessLayer.addElement(project, t1);
accessLayer.addElement(project, t2);
ViolationTypeCatalog c1 = ReportModelFactory.eINSTANCE.createViolationTypeCatalog();
accessLayer.addElement(project, c1);
c1.getViolationTypes().add(t1);
assertEquals(1, c1.getViolationTypes().size());
assertEquals(1, accessLayer.getElements(project, "ViolationTypeCatalog").size());
assertEquals(2, accessLayer.getElements(project, "ViolationType").size());
projectCleaner.cleanUpViolationTypeOrphans(project);
assertEquals(1, c1.getViolationTypes().size());
assertEquals(2, accessLayer.getElements(project, "ViolationType").size());
assertEquals(2, accessLayer.getElements(project, "ViolationTypeCatalog").size());
ViolationType t3 = ReportModelFactory.eINSTANCE.createViolationType();
accessLayer.addElement(project, t3);
assertEquals(3, accessLayer.getElements(project, "ViolationType").size());
projectCleaner.cleanUpViolationTypeOrphans(project);
assertEquals(3, accessLayer.getElements(project, "ViolationType").size());