DefaultOntology implements Ontology { @Override public boolean remove(Rule rule) { boolean res = this.removeWithoutVocReset(rule); if(res) { this.resetVocabulary(); } return res; } DefaultOntology();  DefaultOntology(RuleSet rules);  DefaultOntology(CloseableIterator<Object> parser); @Override Set<String> getRuleNames(); @Override Rule getRule(String name); @Override Set<String> getNegativeConstraintNames(); @Override NegativeConstraint getNegativeConstraint(String name); @Override boolean add(Rule rule); @Override boolean addAll(Iterator<Rule> ruleIterator); @Override boolean addAll(CloseableIterator<Rule> ruleIterator); @Override boolean remove(Rule rule); @Override boolean removeAll(Iterator<Rule> ruleIterator); @Override boolean removeAll(CloseableIterator<Rule> ruleIterator); @Override boolean contains(Rule rule); @Override int size(); @Override Iterator<Rule> iterator(); @Override Set<Predicate> getVocabulary(); @Override boolean isEmpty();  }
@Test public void testRemove() { Ontology onto = new DefaultOntology(); onto.add(r1); onto.remove(r1); Set<String> ruleNames = onto.getRuleNames(); Assert.assertTrue(ruleNames.isEmpty()); }