Callable<Void> call = new Callable<Void>()
{
@Override
public Void call() throws Exception
{
AtomicChangeType t1 = ChangeModelFactory.eINSTANCE.createAtomicChangeType();
AtomicChangeType t2 = ChangeModelFactory.eINSTANCE.createAtomicChangeType();
accessLayer.addElement(project, t1);
accessLayer.addElement(project, t2);
ChangeTypeCatalog c1 = ChangeModelFactory.eINSTANCE.createChangeTypeCatalog();
accessLayer.addElement(project, c1);
c1.getChangeTypes().add(t1);
assertEquals(1, c1.getChangeTypes().size());
assertEquals(1, accessLayer.getElements(project, "ChangeTypeCatalog").size());
assertEquals(2, accessLayer.getElements(project, "AtomicChangeType").size());
projectCleaner.cleanUpChangeTypeOrphans(project);
assertEquals(1, c1.getChangeTypes().size());
assertEquals(2, accessLayer.getElements(project, "AtomicChangeType").size());
assertEquals(2, accessLayer.getElements(project, "ChangeTypeCatalog").size());
AtomicChangeType t3 = ChangeModelFactory.eINSTANCE.createAtomicChangeType();
accessLayer.addElement(project, t3);
assertEquals(3, accessLayer.getElements(project, "AtomicChangeType").size());
projectCleaner.cleanUpChangeTypeOrphans(project);
assertEquals(3, accessLayer.getElements(project, "AtomicChangeType").size());