DefaultOntology implements Ontology { @Override public boolean contains(Rule rule) { return this.map.containsValue(rule); } 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 testContains() { Ontology onto = new DefaultOntology(); onto.add(r1); boolean b = onto.contains(r1); Assert.assertTrue(b); }