Rule r2 = RuleModelFactory.eINSTANCE.createRule();
accessLayer.addElement(project, r1);
accessLayer.addElement(project, r2);
RuleCatalog c1 = RuleModelFactory.eINSTANCE.createRuleCatalog();
accessLayer.addElement(project, c1);
c1.getRules().add(r1);
assertEquals(1, c1.getRules().size());
assertEquals(1, accessLayer.getElements(project, "RuleCatalog").size());
assertEquals(2, accessLayer.getElements(project, "Rule").size());
projectCleaner.cleanUpRuleOrphans(project);
assertEquals(1, c1.getRules().size());
assertEquals(2, accessLayer.getElements(project, "Rule").size());
assertEquals(2, accessLayer.getElements(project, "RuleCatalog").size());
accessLayer.removeElement(project, r2);
assertEquals(1, accessLayer.getElements(project, "Rule").size());