@Test
public void testGetSubClassesOf() throws Exception {

    // Setup:
    Set<Resource> expectedSubjects = Stream.of(vf.createIRI("http://mobi.com/ontology#Class1a"), vf.createIRI("http://mobi.com/ontology#Class1b"),
            vf.createIRI("http://mobi.com/ontology#Class1c"), vf.createIRI("http://mobi.com/ontology#Class2a"), vf.createIRI("http://mobi.com/ontology#Class2b"),
            vf.createIRI("http://mobi.com/ontology#Class3a")).collect(Collectors.toSet());
    Map<String, Set<String>> expectedParentMap = new HashMap<>();
    expectedParentMap.put("http://mobi.com/ontology#Class1a", Collections.singleton("http://mobi.com/ontology#Class1b"));
    expectedParentMap.put("http://mobi.com/ontology#Class1b", Collections.singleton("http://mobi.com/ontology#Class1c"));
    expectedParentMap.put("http://mobi.com/ontology#Class2a", Collections.singleton("http://mobi.com/ontology#Class2b"));
    Map<String, Set<String>> expectedChildMap = new HashMap<>();
    expectedChildMap.put("http://mobi.com/ontology#Class1b", Collections.singleton("http://mobi.com/ontology#Class1a"));
    expectedChildMap.put("http://mobi.com/ontology#Class1c", Collections.singleton("http://mobi.com/ontology#Class1b"));
    expectedChildMap.put("http://mobi.com/ontology#Class2b", Collections.singleton("http://mobi.com/ontology#Class2a"));
    Hierarchy result = queryOntology.getSubClassesOf(vf, mf);
    Map<String, Set<String>> parentMap = result.getParentMap();
    Set<String> parentKeys = parentMap.keySet();
    assertEquals(expectedParentMap.keySet(), parentKeys);
    parentKeys.forEach(iri -> assertEquals(expectedParentMap.get(iri), parentMap.get(iri)));
    Map<String, Set<String>> childMap = result.getChildMap();
    Set<String> childKeys = childMap.keySet();
    assertEquals(expectedChildMap.keySet(), childKeys);
    childKeys.forEach(iri -> assertEquals(expectedChildMap.get(iri), childMap.get(iri)));
    assertEquals(expectedSubjects, result.getModel().subjects());
}